@firebase/messaging 0.9.13 → 0.9.14-canary.ebc17e27f

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,172 +1,172 @@
1
- import { FirebaseApp } from '@firebase/app';
2
- import { NextFn } from '@firebase/util';
3
- import { Observer } from '@firebase/util';
4
- import { Unsubscribe } from '@firebase/util';
5
-
6
- /**
7
- * Enables or disables Firebase Cloud Messaging message delivery metrics export to BigQuery. By
8
- * default, message delivery metrics are not exported to BigQuery. Use this method to enable or
9
- * disable the export at runtime.
10
- *
11
- * @param messaging - The `FirebaseMessaging` instance.
12
- * @param enable - Whether Firebase Cloud Messaging should export message delivery metrics to
13
- * BigQuery.
14
- *
15
- * @public
16
- */
17
- export declare function experimentalSetDeliveryMetricsExportedToBigQueryEnabled(messaging: Messaging, enable: boolean): void;
18
-
19
- /**
20
- * Options for features provided by the FCM SDK for Web. See {@link
21
- * https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#webpushfcmoptions |
22
- * WebpushFcmOptions}
23
- *
24
- * @public
25
- */
26
- export declare interface FcmOptions {
27
- /**
28
- * The link to open when the user clicks on the notification.
29
- */
30
- link?: string;
31
- /**
32
- * The label associated with the message's analytics data.
33
- */
34
- analyticsLabel?: string;
35
- }
36
-
37
- /* Excluded from this release type: _FirebaseMessagingName */
38
-
39
- /**
40
- * Retrieves a Firebase Cloud Messaging instance.
41
- *
42
- * @returns The Firebase Cloud Messaging instance associated with the provided firebase app.
43
- *
44
- * @public
45
- */
46
- export declare function getMessaging(app?: FirebaseApp): Messaging;
47
-
48
- /**
49
- * Options for {@link getToken}
50
- *
51
- * @public
52
- */
53
- export declare interface GetTokenOptions {
54
- /**
55
- * The public server key provided to push services. It is used to
56
- * authenticate the push subscribers to receive push messages only from sending servers that hold
57
- * the corresponding private key. If it is not provided, a default VAPID key is used. Note that some
58
- * push services (Chrome Push Service) require a non-default VAPID key. Therefore, it is recommended
59
- * to generate and import a VAPID key for your project with
60
- * {@link https://firebase.google.com/docs/cloud-messaging/js/client#configure_web_credentials_with_fcm | Configure Web Credentials with FCM}.
61
- * See
62
- * {@link https://developers.google.com/web/fundamentals/push-notifications/web-push-protocol | The Web Push Protocol}
63
- * for details on web push services.
64
- */
65
- vapidKey?: string;
66
- /**
67
- * The service worker registration for receiving push
68
- * messaging. If the registration is not provided explicitly, you need to have a
69
- * `firebase-messaging-sw.js` at your root location. See
70
- * {@link https://firebase.google.com/docs/cloud-messaging/js/client#retrieve-the-current-registration-token | Retrieve the current registration token}
71
- * for more details.
72
- */
73
- serviceWorkerRegistration?: ServiceWorkerRegistration;
74
- }
75
-
76
- /**
77
- * Checks whether all required APIs exist within SW Context
78
- * @returns a Promise that resolves to a boolean.
79
- *
80
- * @public
81
- */
82
- export declare function isSupported(): Promise<boolean>;
83
-
84
- /**
85
- * Message payload that contains the notification payload that is represented with
86
- * {@link NotificationPayload} and the data payload that contains an arbitrary
87
- * number of key-value pairs sent by developers through the
88
- * {@link https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#notification | Send API}
89
- *
90
- * @public
91
- */
92
- export declare interface MessagePayload {
93
- /**
94
- * {@inheritdoc NotificationPayload}
95
- */
96
- notification?: NotificationPayload;
97
- /**
98
- * Arbitrary key/value payload.
99
- */
100
- data?: {
101
- [key: string]: string;
102
- };
103
- /**
104
- * {@inheritdoc FcmOptions}
105
- */
106
- fcmOptions?: FcmOptions;
107
- /**
108
- * The sender of this message.
109
- */
110
- from: string;
111
- /**
112
- * The collapse key of the message. See
113
- * {@link https://firebase.google.com/docs/cloud-messaging/concept-options#collapsible_and_non-collapsible_messages | Non-collapsible and collapsible messages}
114
- */
115
- collapseKey: string;
116
- /**
117
- * The message id of a message.
118
- */
119
- messageId: string;
120
- }
121
-
122
- /**
123
- * Public interface of the Firebase Cloud Messaging SDK.
124
- *
125
- * @public
126
- */
127
- export declare interface Messaging {
128
- /**
129
- * The {@link @firebase/app#FirebaseApp} this `Messaging` instance is associated with.
130
- */
131
- app: FirebaseApp;
132
- }
133
- export { NextFn }
134
-
135
- /**
136
- * Display notification details. They are sent through the
137
- * {@link https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#notification | Send API}
138
- *
139
- * @public
140
- */
141
- export declare interface NotificationPayload {
142
- /**
143
- * The notification's title.
144
- */
145
- title?: string;
146
- /**
147
- * The notification's body text.
148
- */
149
- body?: string;
150
- /**
151
- * The URL of an image that is downloaded on the device and displayed in the notification.
152
- */
153
- image?: string;
154
- }
155
- export { Observer }
156
-
157
- /**
158
- * Called when a message is received while the app is in the background. An app is considered to be
159
- * in the background if no active window is displayed.
160
- *
161
- * @param messaging - The {@link Messaging} instance.
162
- * @param nextOrObserver - This function, or observer object with `next` defined, is called when a
163
- * message is received and the app is currently in the background.
164
- *
165
- * @returns To stop listening for messages execute this returned function
166
- *
167
- * @public
168
- */
169
- export declare function onBackgroundMessage(messaging: Messaging, nextOrObserver: NextFn<MessagePayload> | Observer<MessagePayload>): Unsubscribe;
170
- export { Unsubscribe }
171
-
172
- export { }
1
+ import { FirebaseApp } from '@firebase/app';
2
+ import { NextFn } from '@firebase/util';
3
+ import { Observer } from '@firebase/util';
4
+ import { Unsubscribe } from '@firebase/util';
5
+
6
+ /**
7
+ * Enables or disables Firebase Cloud Messaging message delivery metrics export to BigQuery. By
8
+ * default, message delivery metrics are not exported to BigQuery. Use this method to enable or
9
+ * disable the export at runtime.
10
+ *
11
+ * @param messaging - The `FirebaseMessaging` instance.
12
+ * @param enable - Whether Firebase Cloud Messaging should export message delivery metrics to
13
+ * BigQuery.
14
+ *
15
+ * @public
16
+ */
17
+ export declare function experimentalSetDeliveryMetricsExportedToBigQueryEnabled(messaging: Messaging, enable: boolean): void;
18
+
19
+ /**
20
+ * Options for features provided by the FCM SDK for Web. See {@link
21
+ * https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#webpushfcmoptions |
22
+ * WebpushFcmOptions}
23
+ *
24
+ * @public
25
+ */
26
+ export declare interface FcmOptions {
27
+ /**
28
+ * The link to open when the user clicks on the notification.
29
+ */
30
+ link?: string;
31
+ /**
32
+ * The label associated with the message's analytics data.
33
+ */
34
+ analyticsLabel?: string;
35
+ }
36
+
37
+ /* Excluded from this release type: _FirebaseMessagingName */
38
+
39
+ /**
40
+ * Retrieves a Firebase Cloud Messaging instance.
41
+ *
42
+ * @returns The Firebase Cloud Messaging instance associated with the provided firebase app.
43
+ *
44
+ * @public
45
+ */
46
+ export declare function getMessaging(app?: FirebaseApp): Messaging;
47
+
48
+ /**
49
+ * Options for {@link getToken}
50
+ *
51
+ * @public
52
+ */
53
+ export declare interface GetTokenOptions {
54
+ /**
55
+ * The public server key provided to push services. It is used to
56
+ * authenticate the push subscribers to receive push messages only from sending servers that hold
57
+ * the corresponding private key. If it is not provided, a default VAPID key is used. Note that some
58
+ * push services (Chrome Push Service) require a non-default VAPID key. Therefore, it is recommended
59
+ * to generate and import a VAPID key for your project with
60
+ * {@link https://firebase.google.com/docs/cloud-messaging/js/client#configure_web_credentials_with_fcm | Configure Web Credentials with FCM}.
61
+ * See
62
+ * {@link https://developers.google.com/web/fundamentals/push-notifications/web-push-protocol | The Web Push Protocol}
63
+ * for details on web push services.
64
+ */
65
+ vapidKey?: string;
66
+ /**
67
+ * The service worker registration for receiving push
68
+ * messaging. If the registration is not provided explicitly, you need to have a
69
+ * `firebase-messaging-sw.js` at your root location. See
70
+ * {@link https://firebase.google.com/docs/cloud-messaging/js/client#retrieve-the-current-registration-token | Retrieve the current registration token}
71
+ * for more details.
72
+ */
73
+ serviceWorkerRegistration?: ServiceWorkerRegistration;
74
+ }
75
+
76
+ /**
77
+ * Checks whether all required APIs exist within SW Context
78
+ * @returns a Promise that resolves to a boolean.
79
+ *
80
+ * @public
81
+ */
82
+ export declare function isSupported(): Promise<boolean>;
83
+
84
+ /**
85
+ * Message payload that contains the notification payload that is represented with
86
+ * {@link NotificationPayload} and the data payload that contains an arbitrary
87
+ * number of key-value pairs sent by developers through the
88
+ * {@link https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#notification | Send API}
89
+ *
90
+ * @public
91
+ */
92
+ export declare interface MessagePayload {
93
+ /**
94
+ * {@inheritdoc NotificationPayload}
95
+ */
96
+ notification?: NotificationPayload;
97
+ /**
98
+ * Arbitrary key/value payload.
99
+ */
100
+ data?: {
101
+ [key: string]: string;
102
+ };
103
+ /**
104
+ * {@inheritdoc FcmOptions}
105
+ */
106
+ fcmOptions?: FcmOptions;
107
+ /**
108
+ * The sender of this message.
109
+ */
110
+ from: string;
111
+ /**
112
+ * The collapse key of the message. See
113
+ * {@link https://firebase.google.com/docs/cloud-messaging/concept-options#collapsible_and_non-collapsible_messages | Non-collapsible and collapsible messages}
114
+ */
115
+ collapseKey: string;
116
+ /**
117
+ * The message id of a message.
118
+ */
119
+ messageId: string;
120
+ }
121
+
122
+ /**
123
+ * Public interface of the Firebase Cloud Messaging SDK.
124
+ *
125
+ * @public
126
+ */
127
+ export declare interface Messaging {
128
+ /**
129
+ * The {@link @firebase/app#FirebaseApp} this `Messaging` instance is associated with.
130
+ */
131
+ app: FirebaseApp;
132
+ }
133
+ export { NextFn }
134
+
135
+ /**
136
+ * Display notification details. They are sent through the
137
+ * {@link https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#notification | Send API}
138
+ *
139
+ * @public
140
+ */
141
+ export declare interface NotificationPayload {
142
+ /**
143
+ * The notification's title.
144
+ */
145
+ title?: string;
146
+ /**
147
+ * The notification's body text.
148
+ */
149
+ body?: string;
150
+ /**
151
+ * The URL of an image that is downloaded on the device and displayed in the notification.
152
+ */
153
+ image?: string;
154
+ }
155
+ export { Observer }
156
+
157
+ /**
158
+ * Called when a message is received while the app is in the background. An app is considered to be
159
+ * in the background if no active window is displayed.
160
+ *
161
+ * @param messaging - The {@link Messaging} instance.
162
+ * @param nextOrObserver - This function, or observer object with `next` defined, is called when a
163
+ * message is received and the app is currently in the background.
164
+ *
165
+ * @returns To stop listening for messages execute this returned function
166
+ *
167
+ * @public
168
+ */
169
+ export declare function onBackgroundMessage(messaging: Messaging, nextOrObserver: NextFn<MessagePayload> | Observer<MessagePayload>): Unsubscribe;
170
+ export { Unsubscribe }
171
+
172
+ export { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firebase/messaging",
3
- "version": "0.9.13",
3
+ "version": "0.9.14-canary.ebc17e27f",
4
4
  "description": "",
5
5
  "author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
6
6
  "main": "dist/index.cjs.js",
@@ -11,6 +11,7 @@
11
11
  "esm5": "dist/esm/index.esm.js",
12
12
  "exports": {
13
13
  ".": {
14
+ "types": "./dist/index-public.d.ts",
14
15
  "node": "./dist/index.cjs.js",
15
16
  "browser": "./dist/esm/index.esm2017.js",
16
17
  "module": "./dist/esm/index.esm2017.js",
@@ -18,6 +19,7 @@
18
19
  "default": "./dist/index.cjs.js"
19
20
  },
20
21
  "./sw": {
22
+ "types": "./dist/sw/index-public.d.ts",
21
23
  "node": "./dist/index.sw.cjs",
22
24
  "default": "./dist/index.sw.esm2017.js"
23
25
  },
@@ -49,20 +51,20 @@
49
51
  },
50
52
  "license": "Apache-2.0",
51
53
  "peerDependencies": {
52
- "@firebase/app": "0.x"
54
+ "@firebase/app": "0.7.26-canary.ebc17e27f"
53
55
  },
54
56
  "dependencies": {
55
- "@firebase/installations": "0.5.9",
56
- "@firebase/messaging-interop-types": "0.1.0",
57
- "@firebase/util": "1.6.0",
58
- "@firebase/component": "0.5.14",
57
+ "@firebase/installations": "0.5.10-canary.ebc17e27f",
58
+ "@firebase/messaging-interop-types": "0.1.0-canary.ebc17e27f",
59
+ "@firebase/util": "1.6.1-canary.ebc17e27f",
60
+ "@firebase/component": "0.5.15-canary.ebc17e27f",
59
61
  "idb": "7.0.1",
60
62
  "tslib": "^2.1.0"
61
63
  },
62
64
  "devDependencies": {
63
- "@firebase/app": "0.7.23",
64
- "rollup": "2.57.0",
65
- "rollup-plugin-typescript2": "0.30.0",
65
+ "@firebase/app": "0.7.26-canary.ebc17e27f",
66
+ "rollup": "2.72.1",
67
+ "rollup-plugin-typescript2": "0.31.2",
66
68
  "@rollup/plugin-json": "4.1.0",
67
69
  "ts-essentials": "9.1.2",
68
70
  "typescript": "4.2.2"