@@ -6272,7 +6272,7 @@ declare namespace firebase.messaging {
6272
6272
*/
6273
6273
interface Messaging {
6274
6274
/**
6275
- * To forceably stop a registration token from being used, delete it
6275
+ * To forcibly stop a registration token from being used, delete it
6276
6276
* by calling this method.
6277
6277
*
6278
6278
* @param token The token to delete.
@@ -6281,14 +6281,16 @@ declare namespace firebase.messaging {
6281
6281
*/
6282
6282
deleteToken ( token : string ) : Promise < boolean > ;
6283
6283
/**
6284
- * After calling `requestPermission()` you can call this method to get an FCM
6285
- * registration token that can be used to send push messages to this user.
6284
+ * Subscribes the user to push notifications and returns an FCM registration
6285
+ * token that can be used to send push messages to the user.
6286
6286
*
6287
- * @return The promise resolves if an FCM token can
6288
- * be retrieved. This method returns null if the current origin does not have
6289
- * permission to show notifications.
6287
+ * If notification permission isn't already granted, this method asks the
6288
+ * user for permission. The returned promise rejects if the user does not
6289
+ * allow the app to show notifications.
6290
+ *
6291
+ * @return The promise resolves with the FCM token string.
6290
6292
*/
6291
- getToken ( ) : Promise < string | null > ;
6293
+ getToken ( ) : Promise < string > ;
6292
6294
/**
6293
6295
* When a push message is received and the user is currently on a page
6294
6296
* for your origin, the message is passed to the page and an `onMessage()`
@@ -6327,7 +6329,8 @@ declare namespace firebase.messaging {
6327
6329
/**
6328
6330
* Notification permissions are required to send a user push messages.
6329
6331
* Calling this method displays the permission dialog to the user and
6330
- * resolves if the permission is granted.
6332
+ * resolves if the permission is granted. It is not necessary to call this
6333
+ * method, as `getToken()` will do this automatically if required.
6331
6334
*
6332
6335
* @return The promise resolves if permission is
6333
6336
* granted. Otherwise, the promise is rejected with an error.
0 commit comments