configurePush static method

dynamic configurePush({
  1. required dynamic onNotificationArrival(
    1. Map<String, dynamic>
    ),
  2. required dynamic onNotificationTap(
    1. Map<String, dynamic>
    ),
  3. 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();
}