configurePush static method
dynamic
configurePush({
- required dynamic onNotificationArrival(),
- required dynamic onNotificationTap(),
- required MPAndroidNotificationsSettings androidNotificationsSettings,
Configures the MBPush plugin with the callbacks.
@param onNotificationArrival Called when a push notification arrives. @param onNotificationTap Called when a push notification is tapped. @param androidNotificationsSettings Settings for the android notification.
Implementation
static configurePush({
required Function(Map<String, dynamic>) onNotificationArrival,
required Function(Map<String, dynamic>) onNotificationTap,
required MPAndroidNotificationsSettings androidNotificationsSettings,
}) {
MBPush.configure(
onNotificationArrival: (notification) {
MBMessageMetrics.notificationArrived(notification);
onNotificationArrival(notification);
},
onNotificationTap: (notification) {
MBMessageMetrics.notificationTapped(notification);
onNotificationTap(notification);
},
androidNotificationsSettings: androidNotificationsSettings,
);
MBMessageMetrics.checkLaunchNotification();
}