Skip to content

Commit e0cd828

Browse files
authored
Update Messaging documentation (#2432)
1 parent 4905036 commit e0cd828

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

packages/firebase/index.d.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6272,7 +6272,7 @@ declare namespace firebase.messaging {
62726272
*/
62736273
interface Messaging {
62746274
/**
6275-
* To forceably stop a registration token from being used, delete it
6275+
* To forcibly stop a registration token from being used, delete it
62766276
* by calling this method.
62776277
*
62786278
* @param token The token to delete.
@@ -6281,14 +6281,16 @@ declare namespace firebase.messaging {
62816281
*/
62826282
deleteToken(token: string): Promise<boolean>;
62836283
/**
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.
62866286
*
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.
62906292
*/
6291-
getToken(): Promise<string | null>;
6293+
getToken(): Promise<string>;
62926294
/**
62936295
* When a push message is received and the user is currently on a page
62946296
* for your origin, the message is passed to the page and an `onMessage()`
@@ -6327,7 +6329,8 @@ declare namespace firebase.messaging {
63276329
/**
63286330
* Notification permissions are required to send a user push messages.
63296331
* 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.
63316334
*
63326335
* @return The promise resolves if permission is
63336336
* granted. Otherwise, the promise is rejected with an error.

0 commit comments

Comments
 (0)