FirebaseMessaging class

Implementation of the Firebase Cloud Messaging API for Flutter.

Your app should call requestNotificationPermissions first and then register handlers for incoming messages with configure.

Constructors

FirebaseMessaging()
factory
FirebaseMessaging.private(MethodChannel channel, Platform platform)

Properties

onIosSettingsRegistered → Stream<IosNotificationSettings>
Stream that fires when the user changes their notification settings. [...]
read-only
onTokenRefresh → Stream<String>
Fires when a new FCM token is generated.
read-only
hashCode → int
The hash code for this object.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

autoInitEnabled() → Future<bool>
Determine whether FCM auto-initialization is enabled or disabled.
configure({MessageHandler onMessage, MessageHandler onLaunch, MessageHandler onResume }) → void
Sets up MessageHandler for incoming messages.
deleteInstanceID() → Future<bool>
Resets Instance ID and revokes all tokens. In iOS, it also unregisters from remote notifications. [...]
getToken() → Future<String>
Returns the FCM token.
requestNotificationPermissions([IosNotificationSettings iosSettings = const IosNotificationSettings() ]) → void
On iOS, prompts the user for notification permissions the first time it is called. [...]
setAutoInitEnabled(bool enabled) → Future<void>
Enable or disable auto-initialization of Firebase Cloud Messaging.
subscribeToTopic(String topic) → void
Subscribe to topic in background. [...]
unsubscribeFromTopic(String topic) → void
Unsubscribe from topic in background.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator.
inherited