The Firebase Messaging service interface.
Do not call this constructor directly. Instead, use
To forceably stop a registration token from being used, delete it by calling this method.
The token to delete.
The promise resolves when the token has been successfully deleted.
requestPermission()you can call this method to get an FCM registration token that can be used to send push messages to this user.
Returns Promise<string | null>
The promise resolves if an FCM token can be retrieved. This method returns null if the current origin does not have permission to show notifications.
When a push message is received and the user is currently on a page for your origin, the message is passed to the page and an
onMessage()event is dispatched with the payload of the push message.
NOTE: These events are dispatched when you have called
setBackgroundMessageHandler()in your service worker.
nextOrObserver: firebase.NextFn<any> | Observer<any>
Optional error: firebase.ErrorFn
Optional completed: firebase.CompleteFn
To stop listening for messages execute this returned function.
You should listen for token refreshes so your web app knows when FCM has invalidated your