FcmNotificationService class


FcmNotificationService - Firebase Cloud Messaging Handler

Purpose: Handles Firebase Cloud Messaging (FCM) for push notifications in the app.

  • Requests user permission
  • Displays notifications when app is in foreground
  • Handles notification clicks
  • Provides device token for push notification sending

Usage:


Constructors

FcmNotificationService()

Properties

flutterLocalNotificationsPlugin FlutterLocalNotificationsPlugin
Local Notifications Plugin to show foreground notifications
final
hashCode int
The hash code for this object.
no setterinherited
messaging FirebaseMessaging
Instance of Firebase Messaging.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getDeviceToken() Future<String>
Retrieves the device's unique Firebase Messaging Token. Can be used to send push notifications to this device.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onSelectNotification(String? data) → void
Called when the user taps on a local notification.
registerPushNotificationHandler() Future<void>
toString() String
A string representation of this object.
inherited

Operators

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