@firebase/messaging 0.13.1 → 0.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,10 @@
1
1
  import { FirebaseApp } from '@firebase/app';
2
2
 
3
- import { NextFn , Observer , Unsubscribe } from '@firebase/util';
3
+ import { NextFn } from '@firebase/util';
4
+
5
+ import { Observer } from '@firebase/util';
6
+
7
+ import { Unsubscribe } from '@firebase/util';
4
8
 
5
9
  /**
6
10
  * Enables or disables Firebase Cloud Messaging message delivery metrics export to BigQuery. By
@@ -13,7 +17,11 @@ import { NextFn , Observer , Unsubscribe } from '@firebase/util';
13
17
  *
14
18
  * @public
15
19
  */
16
- export declare function experimentalSetDeliveryMetricsExportedToBigQueryEnabled(messaging: Messaging, enable: boolean): void;
20
+ export declare function experimentalSetDeliveryMetricsExportedToBigQueryEnabled(
21
+ messaging: Messaging,
22
+ enable: boolean
23
+ ): void;
24
+
17
25
  /**
18
26
  * Options for features provided by the FCM SDK for Web. See {@link
19
27
  * https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#webpushfcmoptions |
@@ -22,16 +30,18 @@ export declare function experimentalSetDeliveryMetricsExportedToBigQueryEnabled(
22
30
  * @public
23
31
  */
24
32
  export declare interface FcmOptions {
25
- /**
26
- * The link to open when the user clicks on the notification.
27
- */
28
- link?: string;
29
- /**
30
- * The label associated with the message's analytics data.
31
- */
32
- analyticsLabel?: string;
33
+ /**
34
+ * The link to open when the user clicks on the notification.
35
+ */
36
+ link?: string;
37
+ /**
38
+ * The label associated with the message's analytics data.
39
+ */
40
+ analyticsLabel?: string;
33
41
  }
42
+
34
43
  /* Excluded from this release type: _FirebaseMessagingName */
44
+
35
45
  /**
36
46
  * Retrieves a Firebase Cloud Messaging instance.
37
47
  *
@@ -40,33 +50,35 @@ export declare interface FcmOptions {
40
50
  * @public
41
51
  */
42
52
  export declare function getMessaging(app?: FirebaseApp): Messaging;
53
+
43
54
  /**
44
55
  * Options for {@link getToken}.
45
56
  *
46
57
  * @public
47
58
  */
48
59
  export declare interface GetTokenOptions {
49
- /**
50
- * The public server key provided to push services. The key is used to
51
- * authenticate push subscribers to receive push messages only from sending servers that hold
52
- * the corresponding private key. If it is not provided, a default VAPID key is used. Note that some
53
- * push services (Chrome Push Service) require a non-default VAPID key. Therefore, it is recommended
54
- * to generate and import a VAPID key for your project with
55
- * {@link https://firebase.google.com/docs/cloud-messaging/js/client#configure_web_credentials_in_your_app | Configure Web Credentials with FCM}.
56
- * See
57
- * {@link https://developers.google.com/web/fundamentals/push-notifications/web-push-protocol | The Web Push Protocol}
58
- * for details on web push services.
59
- */
60
- vapidKey?: string;
61
- /**
62
- * The service worker registration for receiving push
63
- * messaging. If the registration is not provided explicitly, you need to have a
64
- * `firebase-messaging-sw.js` at your root location. See
65
- * {@link https://firebase.google.com/docs/cloud-messaging/js/client#access_the_registration_token | Access the registration token}
66
- * for more details.
67
- */
68
- serviceWorkerRegistration?: ServiceWorkerRegistration;
60
+ /**
61
+ * The public server key provided to push services. The key is used to
62
+ * authenticate push subscribers to receive push messages only from sending servers that hold
63
+ * the corresponding private key. If it is not provided, a default VAPID key is used. Note that some
64
+ * push services (Chrome Push Service) require a non-default VAPID key. Therefore, it is recommended
65
+ * to generate and import a VAPID key for your project with
66
+ * {@link https://firebase.google.com/docs/cloud-messaging/js/client#configure_web_credentials_in_your_app | Configure Web Credentials with FCM}.
67
+ * See
68
+ * {@link https://developers.google.com/web/fundamentals/push-notifications/web-push-protocol | The Web Push Protocol}
69
+ * for details on web push services.
70
+ */
71
+ vapidKey?: string;
72
+ /**
73
+ * The service worker registration for receiving push
74
+ * messaging. If the registration is not provided explicitly, you need to have a
75
+ * `firebase-messaging-sw.js` at your root location. See
76
+ * {@link https://firebase.google.com/docs/cloud-messaging/js/client#access_the_registration_token | Access the registration token}
77
+ * for more details.
78
+ */
79
+ serviceWorkerRegistration?: ServiceWorkerRegistration;
69
80
  }
81
+
70
82
  /**
71
83
  * Checks whether all required APIs exist within SW Context
72
84
  * @returns a Promise that resolves to a boolean.
@@ -74,6 +86,7 @@ export declare interface GetTokenOptions {
74
86
  * @public
75
87
  */
76
88
  export declare function isSupported(): Promise<boolean>;
89
+
77
90
  /**
78
91
  * Message payload that contains the notification payload that is represented with
79
92
  * {@link NotificationPayload} and the data payload that contains an arbitrary
@@ -83,46 +96,48 @@ export declare function isSupported(): Promise<boolean>;
83
96
  * @public
84
97
  */
85
98
  export declare interface MessagePayload {
86
- /**
87
- * {@inheritdoc NotificationPayload}
88
- */
89
- notification?: NotificationPayload;
90
- /**
91
- * Arbitrary key/value payload.
92
- */
93
- data?: {
94
- [key: string]: string;
95
- };
96
- /**
97
- * {@inheritdoc FcmOptions}
98
- */
99
- fcmOptions?: FcmOptions;
100
- /**
101
- * The sender of this message.
102
- */
103
- from: string;
104
- /**
105
- * The collapse key of the message. See
106
- * {@link https://firebase.google.com/docs/cloud-messaging/concept-options#collapsible_and_non-collapsible_messages | Non-collapsible and collapsible messages}
107
- */
108
- collapseKey: string;
109
- /**
110
- * The message ID of a message.
111
- */
112
- messageId: string;
99
+ /**
100
+ * {@inheritdoc NotificationPayload}
101
+ */
102
+ notification?: NotificationPayload;
103
+ /**
104
+ * Arbitrary key/value payload.
105
+ */
106
+ data?: {
107
+ [key: string]: string;
108
+ };
109
+ /**
110
+ * {@inheritdoc FcmOptions}
111
+ */
112
+ fcmOptions?: FcmOptions;
113
+ /**
114
+ * The sender of this message.
115
+ */
116
+ from: string;
117
+ /**
118
+ * The collapse key of the message. See
119
+ * {@link https://firebase.google.com/docs/cloud-messaging/concept-options#collapsible_and_non-collapsible_messages | Non-collapsible and collapsible messages}
120
+ */
121
+ collapseKey: string;
122
+ /**
123
+ * The message ID of a message.
124
+ */
125
+ messageId: string;
113
126
  }
127
+
114
128
  /**
115
129
  * Public interface of the Firebase Cloud Messaging SDK.
116
130
  *
117
131
  * @public
118
132
  */
119
133
  export declare interface Messaging {
120
- /**
121
- * The {@link @firebase/app#FirebaseApp} this `Messaging` instance is associated with.
122
- */
123
- app: FirebaseApp;
134
+ /**
135
+ * The {@link @firebase/app#FirebaseApp} this `Messaging` instance is associated with.
136
+ */
137
+ app: FirebaseApp;
124
138
  }
125
139
  export { NextFn };
140
+
126
141
  /**
127
142
  * Display notification details. Details are sent through the
128
143
  * {@link https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#notification | Send API}.
@@ -130,25 +145,26 @@ export { NextFn };
130
145
  * @public
131
146
  */
132
147
  export declare interface NotificationPayload {
133
- /**
134
- * The notification's title.
135
- */
136
- title?: string;
137
- /**
138
- * The notification's body text.
139
- */
140
- body?: string;
141
- /**
142
- * The URL of an image that is downloaded on the device and displayed in the notification.
143
- */
144
- image?: string;
145
- /**
146
- * The URL to use for the notification's icon. If you don't send this key in the request,
147
- * FCM displays the launcher icon specified in your app manifest.
148
- */
149
- icon?: string;
148
+ /**
149
+ * The notification's title.
150
+ */
151
+ title?: string;
152
+ /**
153
+ * The notification's body text.
154
+ */
155
+ body?: string;
156
+ /**
157
+ * The URL of an image that is downloaded on the device and displayed in the notification.
158
+ */
159
+ image?: string;
160
+ /**
161
+ * The URL to use for the notification's icon. If you don't send this key in the request,
162
+ * FCM displays the launcher icon specified in your app manifest.
163
+ */
164
+ icon?: string;
150
165
  }
151
166
  export { Observer };
167
+
152
168
  /**
153
169
  * Called when a message is received while the app is in the background. An app is considered to be
154
170
  * in the background if no active window is displayed.
@@ -161,7 +177,11 @@ export { Observer };
161
177
  *
162
178
  * @public
163
179
  */
164
- export declare function onBackgroundMessage(messaging: Messaging, nextOrObserver: NextFn<MessagePayload> | Observer<MessagePayload>): Unsubscribe;
180
+ export declare function onBackgroundMessage(
181
+ messaging: Messaging,
182
+ nextOrObserver: NextFn<MessagePayload> | Observer<MessagePayload>
183
+ ): Unsubscribe;
184
+
165
185
  /**
166
186
  * Subscribes to an event that the app instance is registered with FCM via Firebase Installation ID (FID).
167
187
  * Use the FID passed to the callback to upload it to your application server. When you receive an FID
@@ -173,7 +193,11 @@ export declare function onBackgroundMessage(messaging: Messaging, nextOrObserver
173
193
  *
174
194
  * @public
175
195
  */
176
- export declare function onRegistered(messaging: Messaging, nextOrObserver: NextFn<string> | Observer<string>): Unsubscribe;
196
+ export declare function onRegistered(
197
+ messaging: Messaging,
198
+ nextOrObserver: NextFn<string> | Observer<string>
199
+ ): Unsubscribe;
200
+
177
201
  /**
178
202
  * Subscribes to an event that the app instance is unregistered from FCM (FID no longer active).
179
203
  * Use this to notify your backend to remove this FID to prevent 404 errors on send.
@@ -184,17 +208,22 @@ export declare function onRegistered(messaging: Messaging, nextOrObserver: NextF
184
208
  *
185
209
  * @public
186
210
  */
187
- export declare function onUnregistered(messaging: Messaging, nextOrObserver: NextFn<string> | Observer<string>): Unsubscribe;
211
+ export declare function onUnregistered(
212
+ messaging: Messaging,
213
+ nextOrObserver: NextFn<string> | Observer<string>
214
+ ): Unsubscribe;
215
+
188
216
  /**
189
217
  * Options for {@link register}. Same shape as GetTokenOptions for SW and VAPID configuration.
190
218
  *
191
219
  * @public
192
220
  */
193
221
  export declare interface RegisterOptions {
194
- /** Optional VAPID key. See {@link GetTokenOptions.vapidKey}. */
195
- vapidKey?: string;
196
- /** Optional service worker registration. See {@link GetTokenOptions.serviceWorkerRegistration}. */
197
- serviceWorkerRegistration?: ServiceWorkerRegistration;
222
+ /** Optional VAPID key. See {@link GetTokenOptions.vapidKey}. */
223
+ vapidKey?: string;
224
+ /** Optional service worker registration. See {@link GetTokenOptions.serviceWorkerRegistration}. */
225
+ serviceWorkerRegistration?: ServiceWorkerRegistration;
198
226
  }
199
227
  export { Unsubscribe };
228
+
200
229
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firebase/messaging",
3
- "version": "0.13.1",
3
+ "version": "0.13.2",
4
4
  "description": "",
5
5
  "author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
6
6
  "main": "dist/index.cjs.js",
@@ -52,15 +52,15 @@
52
52
  "@firebase/app": "0.x"
53
53
  },
54
54
  "dependencies": {
55
- "@firebase/installations": "0.6.23",
56
- "@firebase/messaging-interop-types": "0.2.5",
57
- "@firebase/util": "1.15.2",
58
- "@firebase/component": "0.7.4",
55
+ "@firebase/installations": "0.6.24",
56
+ "@firebase/messaging-interop-types": "0.2.6",
57
+ "@firebase/util": "1.15.3",
58
+ "@firebase/component": "0.7.5",
59
59
  "idb": "7.1.1",
60
60
  "tslib": "^2.1.0"
61
61
  },
62
62
  "devDependencies": {
63
- "@firebase/app": "0.16.0",
63
+ "@firebase/app": "0.16.1",
64
64
  "rollup": "4.62.2",
65
65
  "rollup-plugin-typescript2": "0.37.0",
66
66
  "@rollup/plugin-json": "6.1.0",