@firebase/messaging
Advanced tools
+122
-86
@@ -7,6 +7,11 @@ /** | ||
| */ | ||
| import { FirebaseApp } from '@firebase/app'; | ||
| import { NextFn , Observer , Unsubscribe } from '@firebase/util'; | ||
| import { NextFn } from '@firebase/util'; | ||
| import { Observer } from '@firebase/util'; | ||
| import { Unsubscribe } from '@firebase/util'; | ||
| /** | ||
@@ -31,2 +36,3 @@ * Deletes the registration token associated with this {@link Messaging} instance and unsubscribes | ||
| export declare function deleteToken(messaging: Messaging): Promise<boolean>; | ||
| /** | ||
@@ -40,12 +46,14 @@ * Options for features provided by the FCM SDK for Web. See {@link | ||
| export declare interface FcmOptions { | ||
| /** | ||
| * The link to open when the user clicks on the notification. | ||
| */ | ||
| link?: string; | ||
| /** | ||
| * The label associated with the message's analytics data. | ||
| */ | ||
| analyticsLabel?: string; | ||
| /** | ||
| * The link to open when the user clicks on the notification. | ||
| */ | ||
| link?: string; | ||
| /** | ||
| * The label associated with the message's analytics data. | ||
| */ | ||
| analyticsLabel?: string; | ||
| } | ||
| /* Excluded from this release type: _FirebaseMessagingName */ | ||
| /** | ||
@@ -59,2 +67,3 @@ * Retrieves a Firebase Cloud Messaging instance. | ||
| export declare function getMessaging(app?: FirebaseApp): Messaging; | ||
| /** | ||
@@ -78,3 +87,7 @@ * Subscribes the {@link Messaging} instance to push notifications. Returns a Firebase Cloud | ||
| */ | ||
| export declare function getToken(messaging: Messaging, options?: GetTokenOptions): Promise<string>; | ||
| export declare function getToken( | ||
| messaging: Messaging, | ||
| options?: GetTokenOptions | ||
| ): Promise<string>; | ||
| /** | ||
@@ -86,23 +99,24 @@ * Options for {@link getToken}. | ||
| export declare interface GetTokenOptions { | ||
| /** | ||
| * The public server key provided to push services. The key is used to | ||
| * authenticate push subscribers to receive push messages only from sending servers that hold | ||
| * the corresponding private key. If it is not provided, a default VAPID key is used. Note that some | ||
| * push services (Chrome Push Service) require a non-default VAPID key. Therefore, it is recommended | ||
| * to generate and import a VAPID key for your project with | ||
| * {@link https://firebase.google.com/docs/cloud-messaging/js/client#configure_web_credentials_in_your_app | Configure Web Credentials with FCM}. | ||
| * See | ||
| * {@link https://developers.google.com/web/fundamentals/push-notifications/web-push-protocol | The Web Push Protocol} | ||
| * for details on web push services. | ||
| */ | ||
| vapidKey?: string; | ||
| /** | ||
| * The service worker registration for receiving push | ||
| * messaging. If the registration is not provided explicitly, you need to have a | ||
| * `firebase-messaging-sw.js` at your root location. See | ||
| * {@link https://firebase.google.com/docs/cloud-messaging/js/client#access_the_registration_token | Access the registration token} | ||
| * for more details. | ||
| */ | ||
| serviceWorkerRegistration?: ServiceWorkerRegistration; | ||
| /** | ||
| * The public server key provided to push services. The key is used to | ||
| * authenticate push subscribers to receive push messages only from sending servers that hold | ||
| * the corresponding private key. If it is not provided, a default VAPID key is used. Note that some | ||
| * push services (Chrome Push Service) require a non-default VAPID key. Therefore, it is recommended | ||
| * to generate and import a VAPID key for your project with | ||
| * {@link https://firebase.google.com/docs/cloud-messaging/js/client#configure_web_credentials_in_your_app | Configure Web Credentials with FCM}. | ||
| * See | ||
| * {@link https://developers.google.com/web/fundamentals/push-notifications/web-push-protocol | The Web Push Protocol} | ||
| * for details on web push services. | ||
| */ | ||
| vapidKey?: string; | ||
| /** | ||
| * The service worker registration for receiving push | ||
| * messaging. If the registration is not provided explicitly, you need to have a | ||
| * `firebase-messaging-sw.js` at your root location. See | ||
| * {@link https://firebase.google.com/docs/cloud-messaging/js/client#access_the_registration_token | Access the registration token} | ||
| * for more details. | ||
| */ | ||
| serviceWorkerRegistration?: ServiceWorkerRegistration; | ||
| } | ||
| /** | ||
@@ -131,2 +145,3 @@ * @license | ||
| export declare function isSupported(): Promise<boolean>; | ||
| /** | ||
@@ -141,30 +156,31 @@ * Message payload that contains the notification payload that is represented with | ||
| export declare interface MessagePayload { | ||
| /** | ||
| * {@inheritdoc NotificationPayload} | ||
| */ | ||
| notification?: NotificationPayload; | ||
| /** | ||
| * Arbitrary key/value payload. | ||
| */ | ||
| data?: { | ||
| [key: string]: string; | ||
| }; | ||
| /** | ||
| * {@inheritdoc FcmOptions} | ||
| */ | ||
| fcmOptions?: FcmOptions; | ||
| /** | ||
| * The sender of this message. | ||
| */ | ||
| from: string; | ||
| /** | ||
| * The collapse key of the message. See | ||
| * {@link https://firebase.google.com/docs/cloud-messaging/concept-options#collapsible_and_non-collapsible_messages | Non-collapsible and collapsible messages} | ||
| */ | ||
| collapseKey: string; | ||
| /** | ||
| * The message ID of a message. | ||
| */ | ||
| messageId: string; | ||
| /** | ||
| * {@inheritdoc NotificationPayload} | ||
| */ | ||
| notification?: NotificationPayload; | ||
| /** | ||
| * Arbitrary key/value payload. | ||
| */ | ||
| data?: { | ||
| [key: string]: string; | ||
| }; | ||
| /** | ||
| * {@inheritdoc FcmOptions} | ||
| */ | ||
| fcmOptions?: FcmOptions; | ||
| /** | ||
| * The sender of this message. | ||
| */ | ||
| from: string; | ||
| /** | ||
| * The collapse key of the message. See | ||
| * {@link https://firebase.google.com/docs/cloud-messaging/concept-options#collapsible_and_non-collapsible_messages | Non-collapsible and collapsible messages} | ||
| */ | ||
| collapseKey: string; | ||
| /** | ||
| * The message ID of a message. | ||
| */ | ||
| messageId: string; | ||
| } | ||
| /** | ||
@@ -176,8 +192,9 @@ * Public interface of the Firebase Cloud Messaging SDK. | ||
| export declare interface Messaging { | ||
| /** | ||
| * The {@link @firebase/app#FirebaseApp} this `Messaging` instance is associated with. | ||
| */ | ||
| app: FirebaseApp; | ||
| /** | ||
| * The {@link @firebase/app#FirebaseApp} this `Messaging` instance is associated with. | ||
| */ | ||
| app: FirebaseApp; | ||
| } | ||
| export { NextFn }; | ||
| /** | ||
@@ -190,21 +207,22 @@ * Display notification details. Details are sent through the | ||
| export declare interface NotificationPayload { | ||
| /** | ||
| * The notification's title. | ||
| */ | ||
| title?: string; | ||
| /** | ||
| * The notification's body text. | ||
| */ | ||
| body?: string; | ||
| /** | ||
| * The URL of an image that is downloaded on the device and displayed in the notification. | ||
| */ | ||
| image?: string; | ||
| /** | ||
| * The URL to use for the notification's icon. If you don't send this key in the request, | ||
| * FCM displays the launcher icon specified in your app manifest. | ||
| */ | ||
| icon?: string; | ||
| /** | ||
| * The notification's title. | ||
| */ | ||
| title?: string; | ||
| /** | ||
| * The notification's body text. | ||
| */ | ||
| body?: string; | ||
| /** | ||
| * The URL of an image that is downloaded on the device and displayed in the notification. | ||
| */ | ||
| image?: string; | ||
| /** | ||
| * The URL to use for the notification's icon. If you don't send this key in the request, | ||
| * FCM displays the launcher icon specified in your app manifest. | ||
| */ | ||
| icon?: string; | ||
| } | ||
| export { Observer }; | ||
| /** | ||
@@ -223,3 +241,7 @@ * When a push message is received and the user is currently on a page for your origin, the | ||
| */ | ||
| export declare function onMessage(messaging: Messaging, nextOrObserver: NextFn<MessagePayload> | Observer<MessagePayload>): Unsubscribe; | ||
| export declare function onMessage( | ||
| messaging: Messaging, | ||
| nextOrObserver: NextFn<MessagePayload> | Observer<MessagePayload> | ||
| ): Unsubscribe; | ||
| /** | ||
@@ -236,3 +258,7 @@ * Subscribes to an event that the app instance is registered with FCM via Firebase Installation ID (FID). | ||
| */ | ||
| export declare function onRegistered(messaging: Messaging, nextOrObserver: NextFn<string> | Observer<string>): Unsubscribe; | ||
| export declare function onRegistered( | ||
| messaging: Messaging, | ||
| nextOrObserver: NextFn<string> | Observer<string> | ||
| ): Unsubscribe; | ||
| /** | ||
@@ -248,3 +274,7 @@ * Subscribes to an event that the app instance is unregistered from FCM (FID no longer active). | ||
| */ | ||
| export declare function onUnregistered(messaging: Messaging, nextOrObserver: NextFn<string> | Observer<string>): Unsubscribe; | ||
| export declare function onUnregistered( | ||
| messaging: Messaging, | ||
| nextOrObserver: NextFn<string> | Observer<string> | ||
| ): Unsubscribe; | ||
| /** | ||
@@ -263,3 +293,7 @@ * Registers the app instance with FCM using its Firebase Installation ID (FID). The FID is | ||
| */ | ||
| export declare function register(messaging: Messaging, options?: RegisterOptions): Promise<void>; | ||
| export declare function register( | ||
| messaging: Messaging, | ||
| options?: RegisterOptions | ||
| ): Promise<void>; | ||
| /** | ||
@@ -271,7 +305,8 @@ * Options for {@link register}. Same shape as GetTokenOptions for SW and VAPID configuration. | ||
| export declare interface RegisterOptions { | ||
| /** Optional VAPID key. See {@link GetTokenOptions.vapidKey}. */ | ||
| vapidKey?: string; | ||
| /** Optional service worker registration. See {@link GetTokenOptions.serviceWorkerRegistration}. */ | ||
| serviceWorkerRegistration?: ServiceWorkerRegistration; | ||
| /** Optional VAPID key. See {@link GetTokenOptions.vapidKey}. */ | ||
| vapidKey?: string; | ||
| /** Optional service worker registration. See {@link GetTokenOptions.serviceWorkerRegistration}. */ | ||
| serviceWorkerRegistration?: ServiceWorkerRegistration; | ||
| } | ||
| /** | ||
@@ -287,2 +322,3 @@ * Unregisters the app instance from FCM by deleting its FID-based registration. | ||
| export { Unsubscribe }; | ||
| export {}; |
+114
-85
| import { FirebaseApp } from '@firebase/app'; | ||
| import { NextFn , Observer , Unsubscribe } from '@firebase/util'; | ||
| import { NextFn } from '@firebase/util'; | ||
| import { Observer } from '@firebase/util'; | ||
| import { Unsubscribe } from '@firebase/util'; | ||
| /** | ||
@@ -16,3 +20,7 @@ * Enables or disables Firebase Cloud Messaging message delivery metrics export to BigQuery. By | ||
| */ | ||
| export declare function experimentalSetDeliveryMetricsExportedToBigQueryEnabled(messaging: Messaging, enable: boolean): void; | ||
| export declare function experimentalSetDeliveryMetricsExportedToBigQueryEnabled( | ||
| messaging: Messaging, | ||
| enable: boolean | ||
| ): void; | ||
| /** | ||
@@ -26,12 +34,14 @@ * Options for features provided by the FCM SDK for Web. See {@link | ||
| export declare interface FcmOptions { | ||
| /** | ||
| * The link to open when the user clicks on the notification. | ||
| */ | ||
| link?: string; | ||
| /** | ||
| * The label associated with the message's analytics data. | ||
| */ | ||
| analyticsLabel?: string; | ||
| /** | ||
| * The link to open when the user clicks on the notification. | ||
| */ | ||
| link?: string; | ||
| /** | ||
| * The label associated with the message's analytics data. | ||
| */ | ||
| analyticsLabel?: string; | ||
| } | ||
| /* Excluded from this release type: _FirebaseMessagingName */ | ||
| /** | ||
@@ -45,2 +55,3 @@ * Retrieves a Firebase Cloud Messaging instance. | ||
| export declare function getMessaging(app?: FirebaseApp): Messaging; | ||
| /** | ||
@@ -52,23 +63,24 @@ * Options for {@link getToken}. | ||
| export declare interface GetTokenOptions { | ||
| /** | ||
| * The public server key provided to push services. The key is used to | ||
| * authenticate push subscribers to receive push messages only from sending servers that hold | ||
| * the corresponding private key. If it is not provided, a default VAPID key is used. Note that some | ||
| * push services (Chrome Push Service) require a non-default VAPID key. Therefore, it is recommended | ||
| * to generate and import a VAPID key for your project with | ||
| * {@link https://firebase.google.com/docs/cloud-messaging/js/client#configure_web_credentials_in_your_app | Configure Web Credentials with FCM}. | ||
| * See | ||
| * {@link https://developers.google.com/web/fundamentals/push-notifications/web-push-protocol | The Web Push Protocol} | ||
| * for details on web push services. | ||
| */ | ||
| vapidKey?: string; | ||
| /** | ||
| * The service worker registration for receiving push | ||
| * messaging. If the registration is not provided explicitly, you need to have a | ||
| * `firebase-messaging-sw.js` at your root location. See | ||
| * {@link https://firebase.google.com/docs/cloud-messaging/js/client#access_the_registration_token | Access the registration token} | ||
| * for more details. | ||
| */ | ||
| serviceWorkerRegistration?: ServiceWorkerRegistration; | ||
| /** | ||
| * The public server key provided to push services. The key is used to | ||
| * authenticate push subscribers to receive push messages only from sending servers that hold | ||
| * the corresponding private key. If it is not provided, a default VAPID key is used. Note that some | ||
| * push services (Chrome Push Service) require a non-default VAPID key. Therefore, it is recommended | ||
| * to generate and import a VAPID key for your project with | ||
| * {@link https://firebase.google.com/docs/cloud-messaging/js/client#configure_web_credentials_in_your_app | Configure Web Credentials with FCM}. | ||
| * See | ||
| * {@link https://developers.google.com/web/fundamentals/push-notifications/web-push-protocol | The Web Push Protocol} | ||
| * for details on web push services. | ||
| */ | ||
| vapidKey?: string; | ||
| /** | ||
| * The service worker registration for receiving push | ||
| * messaging. If the registration is not provided explicitly, you need to have a | ||
| * `firebase-messaging-sw.js` at your root location. See | ||
| * {@link https://firebase.google.com/docs/cloud-messaging/js/client#access_the_registration_token | Access the registration token} | ||
| * for more details. | ||
| */ | ||
| serviceWorkerRegistration?: ServiceWorkerRegistration; | ||
| } | ||
| /** | ||
@@ -81,2 +93,3 @@ * Checks whether all required APIs exist within SW Context | ||
| export declare function isSupported(): Promise<boolean>; | ||
| /** | ||
@@ -91,30 +104,31 @@ * Message payload that contains the notification payload that is represented with | ||
| export declare interface MessagePayload { | ||
| /** | ||
| * {@inheritdoc NotificationPayload} | ||
| */ | ||
| notification?: NotificationPayload; | ||
| /** | ||
| * Arbitrary key/value payload. | ||
| */ | ||
| data?: { | ||
| [key: string]: string; | ||
| }; | ||
| /** | ||
| * {@inheritdoc FcmOptions} | ||
| */ | ||
| fcmOptions?: FcmOptions; | ||
| /** | ||
| * The sender of this message. | ||
| */ | ||
| from: string; | ||
| /** | ||
| * The collapse key of the message. See | ||
| * {@link https://firebase.google.com/docs/cloud-messaging/concept-options#collapsible_and_non-collapsible_messages | Non-collapsible and collapsible messages} | ||
| */ | ||
| collapseKey: string; | ||
| /** | ||
| * The message ID of a message. | ||
| */ | ||
| messageId: string; | ||
| /** | ||
| * {@inheritdoc NotificationPayload} | ||
| */ | ||
| notification?: NotificationPayload; | ||
| /** | ||
| * Arbitrary key/value payload. | ||
| */ | ||
| data?: { | ||
| [key: string]: string; | ||
| }; | ||
| /** | ||
| * {@inheritdoc FcmOptions} | ||
| */ | ||
| fcmOptions?: FcmOptions; | ||
| /** | ||
| * The sender of this message. | ||
| */ | ||
| from: string; | ||
| /** | ||
| * The collapse key of the message. See | ||
| * {@link https://firebase.google.com/docs/cloud-messaging/concept-options#collapsible_and_non-collapsible_messages | Non-collapsible and collapsible messages} | ||
| */ | ||
| collapseKey: string; | ||
| /** | ||
| * The message ID of a message. | ||
| */ | ||
| messageId: string; | ||
| } | ||
| /** | ||
@@ -126,8 +140,9 @@ * Public interface of the Firebase Cloud Messaging SDK. | ||
| export declare interface Messaging { | ||
| /** | ||
| * The {@link @firebase/app#FirebaseApp} this `Messaging` instance is associated with. | ||
| */ | ||
| app: FirebaseApp; | ||
| /** | ||
| * The {@link @firebase/app#FirebaseApp} this `Messaging` instance is associated with. | ||
| */ | ||
| app: FirebaseApp; | ||
| } | ||
| export { NextFn }; | ||
| /** | ||
@@ -140,21 +155,22 @@ * Display notification details. Details are sent through the | ||
| export declare interface NotificationPayload { | ||
| /** | ||
| * The notification's title. | ||
| */ | ||
| title?: string; | ||
| /** | ||
| * The notification's body text. | ||
| */ | ||
| body?: string; | ||
| /** | ||
| * The URL of an image that is downloaded on the device and displayed in the notification. | ||
| */ | ||
| image?: string; | ||
| /** | ||
| * The URL to use for the notification's icon. If you don't send this key in the request, | ||
| * FCM displays the launcher icon specified in your app manifest. | ||
| */ | ||
| icon?: string; | ||
| /** | ||
| * The notification's title. | ||
| */ | ||
| title?: string; | ||
| /** | ||
| * The notification's body text. | ||
| */ | ||
| body?: string; | ||
| /** | ||
| * The URL of an image that is downloaded on the device and displayed in the notification. | ||
| */ | ||
| image?: string; | ||
| /** | ||
| * The URL to use for the notification's icon. If you don't send this key in the request, | ||
| * FCM displays the launcher icon specified in your app manifest. | ||
| */ | ||
| icon?: string; | ||
| } | ||
| export { Observer }; | ||
| /** | ||
@@ -172,3 +188,7 @@ * Called when a message is received while the app is in the background. An app is considered to be | ||
| */ | ||
| export declare function onBackgroundMessage(messaging: Messaging, nextOrObserver: NextFn<MessagePayload> | Observer<MessagePayload>): Unsubscribe; | ||
| export declare function onBackgroundMessage( | ||
| messaging: Messaging, | ||
| nextOrObserver: NextFn<MessagePayload> | Observer<MessagePayload> | ||
| ): Unsubscribe; | ||
| /** | ||
@@ -185,3 +205,7 @@ * Subscribes to an event that the app instance is registered with FCM via Firebase Installation ID (FID). | ||
| */ | ||
| export declare function onRegistered(messaging: Messaging, nextOrObserver: NextFn<string> | Observer<string>): Unsubscribe; | ||
| export declare function onRegistered( | ||
| messaging: Messaging, | ||
| nextOrObserver: NextFn<string> | Observer<string> | ||
| ): Unsubscribe; | ||
| /** | ||
@@ -197,3 +221,7 @@ * Subscribes to an event that the app instance is unregistered from FCM (FID no longer active). | ||
| */ | ||
| export declare function onUnregistered(messaging: Messaging, nextOrObserver: NextFn<string> | Observer<string>): Unsubscribe; | ||
| export declare function onUnregistered( | ||
| messaging: Messaging, | ||
| nextOrObserver: NextFn<string> | Observer<string> | ||
| ): Unsubscribe; | ||
| /** | ||
@@ -205,8 +233,9 @@ * Options for {@link register}. Same shape as GetTokenOptions for SW and VAPID configuration. | ||
| export declare interface RegisterOptions { | ||
| /** Optional VAPID key. See {@link GetTokenOptions.vapidKey}. */ | ||
| vapidKey?: string; | ||
| /** Optional service worker registration. See {@link GetTokenOptions.serviceWorkerRegistration}. */ | ||
| serviceWorkerRegistration?: ServiceWorkerRegistration; | ||
| /** Optional VAPID key. See {@link GetTokenOptions.vapidKey}. */ | ||
| vapidKey?: string; | ||
| /** Optional service worker registration. See {@link GetTokenOptions.serviceWorkerRegistration}. */ | ||
| serviceWorkerRegistration?: ServiceWorkerRegistration; | ||
| } | ||
| export { Unsubscribe }; | ||
| export {}; |
+7
-7
| { | ||
| "name": "@firebase/messaging", | ||
| "version": "0.13.1", | ||
| "version": "0.13.2-20260818172054", | ||
| "description": "", | ||
@@ -52,9 +52,9 @@ "author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)", | ||
| "peerDependencies": { | ||
| "@firebase/app": "0.x" | ||
| "@firebase/app": "0.16.1-20260818172054" | ||
| }, | ||
| "dependencies": { | ||
| "@firebase/installations": "0.6.23", | ||
| "@firebase/messaging-interop-types": "0.2.5", | ||
| "@firebase/util": "1.15.2", | ||
| "@firebase/component": "0.7.4", | ||
| "@firebase/installations": "0.6.24-20260818172054", | ||
| "@firebase/messaging-interop-types": "0.2.6-20260818172054", | ||
| "@firebase/util": "1.15.3-20260818172054", | ||
| "@firebase/component": "0.7.5-20260818172054", | ||
| "idb": "7.1.1", | ||
@@ -64,3 +64,3 @@ "tslib": "^2.1.0" | ||
| "devDependencies": { | ||
| "@firebase/app": "0.16.0", | ||
| "@firebase/app": "0.16.1-20260818172054", | ||
| "rollup": "4.62.2", | ||
@@ -67,0 +67,0 @@ "rollup-plugin-typescript2": "0.37.0", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1112467
012877
0.24%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated