New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@firebase/messaging

Package Overview
Dependencies
Maintainers
3
Versions
3350
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@firebase/messaging - npm Package Compare versions

Comparing version 0.2.2-canary.9d00c6f to 0.2.2-canary.ab0faeb

5

dist/cjs/src/controllers/controller-interface.d.ts

@@ -46,4 +46,7 @@ import TokenDetailsModel from '../models/token-details-model';

requestPermission(): void;
getPushSubscription_(registration: any, publicVapidKey: any): Promise<PushSubscription>;
/**
* Gets a PushSubscription for the current user.
*/
getPushSubscription(swRegistration: ServiceWorkerRegistration, publicVapidKey: Uint8Array): Promise<PushSubscription>;
/**
* @export

@@ -50,0 +53,0 @@ * @param {!ServiceWorkerRegistration} registration

19

dist/cjs/src/controllers/controller-interface.js

@@ -125,3 +125,3 @@ /**

publicVapidKey = publicKey;
return _this.getPushSubscription_(swReg, publicVapidKey);
return _this.getPushSubscription(swReg, publicVapidKey);
})

@@ -164,3 +164,3 @@ .then(function (pushSubscription) {

publicVapidKey = publicKey;
return _this.getPushSubscription_(swReg, publicVapidKey);
return _this.getPushSubscription(swReg, publicVapidKey);
})

@@ -230,4 +230,15 @@ .then(function (pushSubscription) {

};
ControllerInterface.prototype.getPushSubscription_ = function (registration, publicVapidKey) {
throw this.errorFactory_.create(errors_1.default.codes.AVAILABLE_IN_WINDOW);
/**
* Gets a PushSubscription for the current user.
*/
ControllerInterface.prototype.getPushSubscription = function (swRegistration, publicVapidKey) {
return swRegistration.pushManager.getSubscription().then(function (subscription) {
if (subscription) {
return subscription;
}
return swRegistration.pushManager.subscribe({
userVisibleOnly: true,
applicationServerKey: publicVapidKey
});
});
};

@@ -234,0 +245,0 @@ /**

@@ -102,9 +102,2 @@ import { FirebaseMessaging } from '@firebase/messaging-types';

/**
* Gets a PushSubscription for the current user.
* @private
* @param {ServiceWorkerRegistration} registration
* @return {Promise<PushSubscription>}
*/
getPushSubscription_(swRegistration: any, publicVapidKey: any): any;
/**
* This method will set up a message listener to handle

@@ -111,0 +104,0 @@ * events from the service worker that should trigger

@@ -322,22 +322,2 @@ /**

/**
* Gets a PushSubscription for the current user.
* @private
* @param {ServiceWorkerRegistration} registration
* @return {Promise<PushSubscription>}
*/
WindowController.prototype.getPushSubscription_ = function (swRegistration, publicVapidKey) {
// Check for existing subscription first
var subscription;
var fcmTokenDetails;
return swRegistration.pushManager.getSubscription().then(function (subscription) {
if (subscription) {
return subscription;
}
return swRegistration.pushManager.subscribe({
userVisibleOnly: true,
applicationServerKey: publicVapidKey
});
});
};
/**
* This method will set up a message listener to handle

@@ -344,0 +324,0 @@ * events from the service worker that should trigger

@@ -46,4 +46,7 @@ import TokenDetailsModel from '../models/token-details-model';

requestPermission(): void;
getPushSubscription_(registration: any, publicVapidKey: any): Promise<PushSubscription>;
/**
* Gets a PushSubscription for the current user.
*/
getPushSubscription(swRegistration: ServiceWorkerRegistration, publicVapidKey: Uint8Array): Promise<PushSubscription>;
/**
* @export

@@ -50,0 +53,0 @@ * @param {!ServiceWorkerRegistration} registration

@@ -124,3 +124,3 @@ /**

publicVapidKey = publicKey;
return _this.getPushSubscription_(swReg, publicVapidKey);
return _this.getPushSubscription(swReg, publicVapidKey);
})

@@ -163,3 +163,3 @@ .then(function (pushSubscription) {

publicVapidKey = publicKey;
return _this.getPushSubscription_(swReg, publicVapidKey);
return _this.getPushSubscription(swReg, publicVapidKey);
})

@@ -229,4 +229,15 @@ .then(function (pushSubscription) {

};
ControllerInterface.prototype.getPushSubscription_ = function (registration, publicVapidKey) {
throw this.errorFactory_.create(Errors.codes.AVAILABLE_IN_WINDOW);
/**
* Gets a PushSubscription for the current user.
*/
ControllerInterface.prototype.getPushSubscription = function (swRegistration, publicVapidKey) {
return swRegistration.pushManager.getSubscription().then(function (subscription) {
if (subscription) {
return subscription;
}
return swRegistration.pushManager.subscribe({
userVisibleOnly: true,
applicationServerKey: publicVapidKey
});
});
};

@@ -233,0 +244,0 @@ /**

@@ -102,9 +102,2 @@ import { FirebaseMessaging } from '@firebase/messaging-types';

/**
* Gets a PushSubscription for the current user.
* @private
* @param {ServiceWorkerRegistration} registration
* @return {Promise<PushSubscription>}
*/
getPushSubscription_(swRegistration: any, publicVapidKey: any): any;
/**
* This method will set up a message listener to handle

@@ -111,0 +104,0 @@ * events from the service worker that should trigger

@@ -321,22 +321,2 @@ /**

/**
* Gets a PushSubscription for the current user.
* @private
* @param {ServiceWorkerRegistration} registration
* @return {Promise<PushSubscription>}
*/
WindowController.prototype.getPushSubscription_ = function (swRegistration, publicVapidKey) {
// Check for existing subscription first
var subscription;
var fcmTokenDetails;
return swRegistration.pushManager.getSubscription().then(function (subscription) {
if (subscription) {
return subscription;
}
return swRegistration.pushManager.subscribe({
userVisibleOnly: true,
applicationServerKey: publicVapidKey
});
});
};
/**
* This method will set up a message listener to handle

@@ -343,0 +323,0 @@ * events from the service worker that should trigger

{
"name": "@firebase/messaging",
"version": "0.2.2-canary.9d00c6f",
"version": "0.2.2-canary.ab0faeb",
"description": "",

@@ -16,7 +16,7 @@ "author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",

"peerDependencies": {
"@firebase/app": "0.1.10-canary.9d00c6f"
"@firebase/app": "0.1.10-canary.ab0faeb"
},
"dependencies": {
"@firebase/messaging-types": "0.1.2-canary.9d00c6f",
"@firebase/util": "0.1.10-canary.9d00c6f",
"@firebase/messaging-types": "0.1.2-canary.ab0faeb",
"@firebase/util": "0.1.10-canary.ab0faeb",
"tslib": "^1.9.0"

@@ -23,0 +23,0 @@ },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc