@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,175 +1,175 @@
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
- /**
38
- * @internal
39
- */
40
- export declare type _FirebaseMessagingName = 'messaging';
41
-
42
- /**
43
- * Retrieves a Firebase Cloud Messaging instance.
44
- *
45
- * @returns The Firebase Cloud Messaging instance associated with the provided firebase app.
46
- *
47
- * @public
48
- */
49
- export declare function getMessaging(app?: FirebaseApp): Messaging;
50
-
51
- /**
52
- * Options for {@link getToken}
53
- *
54
- * @public
55
- */
56
- export declare interface GetTokenOptions {
57
- /**
58
- * The public server key provided to push services. It is used to
59
- * authenticate the push subscribers to receive push messages only from sending servers that hold
60
- * the corresponding private key. If it is not provided, a default VAPID key is used. Note that some
61
- * push services (Chrome Push Service) require a non-default VAPID key. Therefore, it is recommended
62
- * to generate and import a VAPID key for your project with
63
- * {@link https://firebase.google.com/docs/cloud-messaging/js/client#configure_web_credentials_with_fcm | Configure Web Credentials with FCM}.
64
- * See
65
- * {@link https://developers.google.com/web/fundamentals/push-notifications/web-push-protocol | The Web Push Protocol}
66
- * for details on web push services.
67
- */
68
- vapidKey?: string;
69
- /**
70
- * The service worker registration for receiving push
71
- * messaging. If the registration is not provided explicitly, you need to have a
72
- * `firebase-messaging-sw.js` at your root location. See
73
- * {@link https://firebase.google.com/docs/cloud-messaging/js/client#retrieve-the-current-registration-token | Retrieve the current registration token}
74
- * for more details.
75
- */
76
- serviceWorkerRegistration?: ServiceWorkerRegistration;
77
- }
78
-
79
- /**
80
- * Checks whether all required APIs exist within SW Context
81
- * @returns a Promise that resolves to a boolean.
82
- *
83
- * @public
84
- */
85
- export declare function isSupported(): Promise<boolean>;
86
-
87
- /**
88
- * Message payload that contains the notification payload that is represented with
89
- * {@link NotificationPayload} and the data payload that contains an arbitrary
90
- * number of key-value pairs sent by developers through the
91
- * {@link https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#notification | Send API}
92
- *
93
- * @public
94
- */
95
- export declare interface MessagePayload {
96
- /**
97
- * {@inheritdoc NotificationPayload}
98
- */
99
- notification?: NotificationPayload;
100
- /**
101
- * Arbitrary key/value payload.
102
- */
103
- data?: {
104
- [key: string]: string;
105
- };
106
- /**
107
- * {@inheritdoc FcmOptions}
108
- */
109
- fcmOptions?: FcmOptions;
110
- /**
111
- * The sender of this message.
112
- */
113
- from: string;
114
- /**
115
- * The collapse key of the message. See
116
- * {@link https://firebase.google.com/docs/cloud-messaging/concept-options#collapsible_and_non-collapsible_messages | Non-collapsible and collapsible messages}
117
- */
118
- collapseKey: string;
119
- /**
120
- * The message id of a message.
121
- */
122
- messageId: string;
123
- }
124
-
125
- /**
126
- * Public interface of the Firebase Cloud Messaging SDK.
127
- *
128
- * @public
129
- */
130
- export declare interface Messaging {
131
- /**
132
- * The {@link @firebase/app#FirebaseApp} this `Messaging` instance is associated with.
133
- */
134
- app: FirebaseApp;
135
- }
136
- export { NextFn }
137
-
138
- /**
139
- * Display notification details. They are sent through the
140
- * {@link https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#notification | Send API}
141
- *
142
- * @public
143
- */
144
- export declare interface NotificationPayload {
145
- /**
146
- * The notification's title.
147
- */
148
- title?: string;
149
- /**
150
- * The notification's body text.
151
- */
152
- body?: string;
153
- /**
154
- * The URL of an image that is downloaded on the device and displayed in the notification.
155
- */
156
- image?: string;
157
- }
158
- export { Observer }
159
-
160
- /**
161
- * Called when a message is received while the app is in the background. An app is considered to be
162
- * in the background if no active window is displayed.
163
- *
164
- * @param messaging - The {@link Messaging} instance.
165
- * @param nextOrObserver - This function, or observer object with `next` defined, is called when a
166
- * message is received and the app is currently in the background.
167
- *
168
- * @returns To stop listening for messages execute this returned function
169
- *
170
- * @public
171
- */
172
- export declare function onBackgroundMessage(messaging: Messaging, nextOrObserver: NextFn<MessagePayload> | Observer<MessagePayload>): Unsubscribe;
173
- export { Unsubscribe }
174
-
175
- 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
+ /**
38
+ * @internal
39
+ */
40
+ export declare type _FirebaseMessagingName = 'messaging';
41
+
42
+ /**
43
+ * Retrieves a Firebase Cloud Messaging instance.
44
+ *
45
+ * @returns The Firebase Cloud Messaging instance associated with the provided firebase app.
46
+ *
47
+ * @public
48
+ */
49
+ export declare function getMessaging(app?: FirebaseApp): Messaging;
50
+
51
+ /**
52
+ * Options for {@link getToken}
53
+ *
54
+ * @public
55
+ */
56
+ export declare interface GetTokenOptions {
57
+ /**
58
+ * The public server key provided to push services. It is used to
59
+ * authenticate the push subscribers to receive push messages only from sending servers that hold
60
+ * the corresponding private key. If it is not provided, a default VAPID key is used. Note that some
61
+ * push services (Chrome Push Service) require a non-default VAPID key. Therefore, it is recommended
62
+ * to generate and import a VAPID key for your project with
63
+ * {@link https://firebase.google.com/docs/cloud-messaging/js/client#configure_web_credentials_with_fcm | Configure Web Credentials with FCM}.
64
+ * See
65
+ * {@link https://developers.google.com/web/fundamentals/push-notifications/web-push-protocol | The Web Push Protocol}
66
+ * for details on web push services.
67
+ */
68
+ vapidKey?: string;
69
+ /**
70
+ * The service worker registration for receiving push
71
+ * messaging. If the registration is not provided explicitly, you need to have a
72
+ * `firebase-messaging-sw.js` at your root location. See
73
+ * {@link https://firebase.google.com/docs/cloud-messaging/js/client#retrieve-the-current-registration-token | Retrieve the current registration token}
74
+ * for more details.
75
+ */
76
+ serviceWorkerRegistration?: ServiceWorkerRegistration;
77
+ }
78
+
79
+ /**
80
+ * Checks whether all required APIs exist within SW Context
81
+ * @returns a Promise that resolves to a boolean.
82
+ *
83
+ * @public
84
+ */
85
+ export declare function isSupported(): Promise<boolean>;
86
+
87
+ /**
88
+ * Message payload that contains the notification payload that is represented with
89
+ * {@link NotificationPayload} and the data payload that contains an arbitrary
90
+ * number of key-value pairs sent by developers through the
91
+ * {@link https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#notification | Send API}
92
+ *
93
+ * @public
94
+ */
95
+ export declare interface MessagePayload {
96
+ /**
97
+ * {@inheritdoc NotificationPayload}
98
+ */
99
+ notification?: NotificationPayload;
100
+ /**
101
+ * Arbitrary key/value payload.
102
+ */
103
+ data?: {
104
+ [key: string]: string;
105
+ };
106
+ /**
107
+ * {@inheritdoc FcmOptions}
108
+ */
109
+ fcmOptions?: FcmOptions;
110
+ /**
111
+ * The sender of this message.
112
+ */
113
+ from: string;
114
+ /**
115
+ * The collapse key of the message. See
116
+ * {@link https://firebase.google.com/docs/cloud-messaging/concept-options#collapsible_and_non-collapsible_messages | Non-collapsible and collapsible messages}
117
+ */
118
+ collapseKey: string;
119
+ /**
120
+ * The message id of a message.
121
+ */
122
+ messageId: string;
123
+ }
124
+
125
+ /**
126
+ * Public interface of the Firebase Cloud Messaging SDK.
127
+ *
128
+ * @public
129
+ */
130
+ export declare interface Messaging {
131
+ /**
132
+ * The {@link @firebase/app#FirebaseApp} this `Messaging` instance is associated with.
133
+ */
134
+ app: FirebaseApp;
135
+ }
136
+ export { NextFn }
137
+
138
+ /**
139
+ * Display notification details. They are sent through the
140
+ * {@link https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#notification | Send API}
141
+ *
142
+ * @public
143
+ */
144
+ export declare interface NotificationPayload {
145
+ /**
146
+ * The notification's title.
147
+ */
148
+ title?: string;
149
+ /**
150
+ * The notification's body text.
151
+ */
152
+ body?: string;
153
+ /**
154
+ * The URL of an image that is downloaded on the device and displayed in the notification.
155
+ */
156
+ image?: string;
157
+ }
158
+ export { Observer }
159
+
160
+ /**
161
+ * Called when a message is received while the app is in the background. An app is considered to be
162
+ * in the background if no active window is displayed.
163
+ *
164
+ * @param messaging - The {@link Messaging} instance.
165
+ * @param nextOrObserver - This function, or observer object with `next` defined, is called when a
166
+ * message is received and the app is currently in the background.
167
+ *
168
+ * @returns To stop listening for messages execute this returned function
169
+ *
170
+ * @public
171
+ */
172
+ export declare function onBackgroundMessage(messaging: Messaging, nextOrObserver: NextFn<MessagePayload> | Observer<MessagePayload>): Unsubscribe;
173
+ export { Unsubscribe }
174
+
175
+ export { }