addMessageReceiver method

  1. @override
void addMessageReceiver({
  1. PushCallback? onNotification,
  2. PushCallback? onMessage,
  3. PushCallback? onNotificationOpened,
  4. PushCallback? onNotificationRemoved,
  5. PushCallback? onAndroidNotificationReceivedInApp,
  6. PushCallback? onAndroidNotificationClickedWithNoAction,
  7. PushCallback? onIOSChannelOpened,
  8. PushCallback? onIOSRegisterDeviceTokenSuccess,
  9. PushCallback? onIOSRegisterDeviceTokenFailed,
})
override

Implementation

@override
void addMessageReceiver({
  PushCallback? onNotification,
  PushCallback? onMessage,
  PushCallback? onNotificationOpened,
  PushCallback? onNotificationRemoved,
  PushCallback? onAndroidNotificationReceivedInApp,
  PushCallback? onAndroidNotificationClickedWithNoAction,
  PushCallback? onIOSChannelOpened,
  PushCallback? onIOSRegisterDeviceTokenSuccess,
  PushCallback? onIOSRegisterDeviceTokenFailed,
}) {
  _onNotification = onNotification;
  _onAndroidNotificationReceivedInApp = onAndroidNotificationReceivedInApp;
  _onMessage = onMessage;
  _onNotificationOpened = onNotificationOpened;
  _onNotificationRemoved = onNotificationRemoved;
  _onAndroidNotificationClickedWithNoAction =
      onAndroidNotificationClickedWithNoAction;
  _onIOSChannelOpened = onIOSChannelOpened;
  _onIOSRegisterDeviceTokenSuccess = onIOSRegisterDeviceTokenSuccess;
  _onIOSRegisterDeviceTokenFailed = onIOSRegisterDeviceTokenFailed;

  methodChannel.setMethodCallHandler(_methodCallHandler);
}