MessagingService class

MessagingService

Push notification will be appears on system tray(or on the top of the mobile device) when the app is closed or in background state.

onBackgroundMessage is being invoked when the app is closed(terminated). (NOT running the app.)

onForegroundMessage will be called when the user(or device) receives a push notification while the app is running and in foreground state.

onMessageOpenedFromBackground will be called when the user tapped on the push notification on system tray while the app was running but in background state.

onMessageOpenedFromTerminated will be called when the user tapped on the push notification on system tray while the app was closed(terminated).

Properties

customizeTopic List<CustomizeMessagingTopic>?
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
initialized bool
getter/setter pair
onForegroundMessage ↔ dynamic Function(RemoteMessage)
getter/setter pair
onMessageOpenedFromBackground ↔ dynamic Function(RemoteMessage)
getter/setter pair
onMessageOpenedFromTerminated ↔ dynamic Function(RemoteMessage)
getter/setter pair
onNotificationPermissionDenied Function
getter/setter pair
onNotificationPermissionNotDetermined Function
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sendUrl String?
getter/setter pair
token String?
getter/setter pair

Methods

init({required Future<void> onBackgroundMessage(RemoteMessage)?, required dynamic onForegroundMessage(RemoteMessage), required dynamic onMessageOpenedFromTerminated(RemoteMessage), required dynamic onMessageOpenedFromBackground(RemoteMessage), required Function onNotificationPermissionDenied, required Function onNotificationPermissionNotDetermined, String? sendUrl}) → dynamic
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parseData(Map<String, dynamic> data) → dynamic
Parse message data from RemoteMessage.data
send({required List<String> tokens, required String title, required String body, required String senderUid, String? badge, String? channelId, String? sound, String? action, Map<String, dynamic>? extra, int numberOfChunks = 255, bool removeInvalidTokens = true, String? image}) Future<Map<String, String>>
uids 는 배열로 입력되어야 하고, 여기서 콤마로 분리된 문자열로 만들어 서버로 보낸다. 즉, 서버에서는 문자열이어야 한다.
sendAll({required String title, required String body, String? image, Map<String, dynamic>? extra}) Future<Map<String, String>>
sendTo({String? uid, List<String>? uids, required String title, required String body, String? image, Map<String, dynamic>? extra}) Future<Map<String, String>?>
Send message to one user or multiple users uid sending a notification to a single uid uids sending a notification to multiple uids extra sending a extra data to determine what type of message your passing
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

instance MessagingService
no setter