FCMService class

1: register this service using a DI package (e.g. GetX) 2: set fcmServiceFinder to a function that returns the FCMService singleton (e.g. Get.find

Constructors

FCMService()

Properties

canUseFCM bool
no setter
hashCode int
The hash code for this object.
no setterinherited
onTokenRefresh Stream<String>
Convenience stream for FirebaseMessaging.onTokenRefresh
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

doInit({FCMRequestFunc? requestFunc, TargetPlatform? platform}) Future<RemoteMessage?>
get current platform from
getToken({String? vapidKey, bool logResult = true}) Future<String?>
Used to get the FCM token and logs the result
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onClose() Future<void>
Call this to dispose the service, cancels all streams and removes all subscribers
registerSubscriber(NotificationHandlerFunc handler) → void
Registers a notification subscriber
toString() String
A string representation of this object.
inherited
unregisterSubscriber(NotificationHandlerFunc handler) → void
unRegisters a notification subscriber

Operators

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