Messaging class

Properties

hashCode int
The hash code for this object.
no setterinherited
jsObject → MessagingJsImpl
JS object.
finalinherited
onBackgroundMessage Stream<Payload>
FCM directs push messages to your web page's onMessage callback if the user currently has it open.
no setter
onMessage Stream<Payload>
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.
no setter
onTokenRefresh Stream<void>
You should listen for token refreshes so your web app knows when FCM has invalidated your existing token and you need to call getToken to get a new token.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

deleteToken(String token) → void
To forcibly stop a registration token from being used, delete it by calling this method. Calling this method will stop the periodic data transmission to the FCM backend.
getToken() Future<String>
After calling requestPermission you can call this method to get an FCM registration token that can be used to send push messages to this user.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
requestPermission() Future
Notification permissions are required to send a user push messages. Calling this method displays the permission dialog to the user and resolves if the permission is granted.
toString() String
A string representation of this object.
inherited
usePublicVapidKey(String key) → void
To set your own server application key, you can specify here the public key you set up from the Firebase Console under the Settings options.
useServiceWorker(dynamic registration) → void
To use your own service worker for receiving push messages, you can pass in your service worker registration in this method.

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

getInstance(MessagingJsImpl jsObject) Messaging
isSupported() bool