fcmToAppNotification function

AppNotification? fcmToAppNotification(
  1. RemoteMessage fcmMessage
)

Maps a firebase remote message to a AppNotification

Returns null if the given message is not an app notification with the standard structure.

Implementation

AppNotification? fcmToAppNotification(RemoteMessage fcmMessage) {
  if (fcmMessage.data['messageType'] == kOncueDeviceMessageType) {
    return _oncueDeviceHostFcmToAppNotification(fcmMessage);
  } else if (fcmMessage.data['MessageType'] == kHepDeviceMessageType ||
      fcmMessage.data['MessageType'] == kHepV2DeviceMessageType) {
    return _hepDeviceHostFcmToNotificationType(fcmMessage);
  } else {
    return null;
  }
}