MPush class

The MPush plugin, used to interact with MPush

Constructors

MPush()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

apiToken String
The api token of the MPush project
getter/setter pair
onNotificationArrival → (dynamic Function(Map<String, dynamic>)?)
no setter
onNotificationTap → (dynamic Function(Map<String, dynamic>)?)
no setter
onToken ↔ (dynamic Function(String)?)
Callback called when a token is retrieved from APNS or FCM
getter/setter pair

Static Methods

addCustomReplacements({required Map<String, String>? customData}) Future<void>
Adds custom replacements map to the notifications. Map keys are the strings to replace with the values Saved data persists between app openings
configure({required dynamic onNotificationArrival(Map<String, dynamic>), required dynamic onNotificationTap(Map<String, dynamic>), required MPAndroidNotificationsSettings androidNotificationsSettings}) Future<void>
Configures the MPush plugin with the callbacks.
getCustomReplacements() Future<Map<String, String>?>
Get the current saved custom replacements. It will be null if no map has been saved
launchNotification() Future<Map<String, dynamic>?>
The notification that launched the app, if present, otherwise null.
notificationPermission() Future<MPushNotificationPermission>
Returns the current push notification permission status
registerDevice(String token) Future<void>
Register a device token.
registerToTopic(MPTopic topic) Future<void>
Register the current device to a topic.
registerToTopics(List<MPTopic> topics) Future<void>
Register the current device to an array of topics.
removeCustomReplacements() Future<void>
Removes previously custom replacements map to the notifications.
requestToken() Future<void>
Requests the token to APNS & GCM.
unregisterFromAllTopics() Future<void>
Unregister the current device from all topics it is registred to.
unregisterFromTopic(String topic) Future<void>
Unregister the current device from a topic, the topic is matched using the code of the topic.
unregisterFromTopics(List<String> topics) Future<void>
Unregister the current device from an array of topics, the topics are matched using the code of the topic.