When you receive a push notification it is necessary to distinguish between push notifications received from the Hurree platform or the current application.
This method determines whether the push notification is sent from the HurreeSDK or the current application. If the push notification is sent from the HurreeSDK, it returns true; if it is sent from the current application, it returns false.
We detect the response in two ways - one from GCM and other from FCM.
For GCM we are going to get a
bundle in response then pass
map, and for FCM we are going to get a
map in response then we pass
This feature gives backwards compatibility for existing GCM users.
boolean pushNotificationWasSentFromHurree(Bundle gcmData, Map<String, String> fcmData)
To add the method
- Open your project.
- Open app > src > main > java > package name > MyFirebaseMessagingService.
- Add the method code:
These are the arguments that define the method.
|gcmData||Bundle||Mandatory||Bundle is the GCM data that you receive in MyFirebaseMessagingService. It is null when the message is received from FCM.|
|fcmData||Map||Mandatory||Map is the FCM data that you receive in MyFirebaseMessagingService. It is null when the message is received from GCM.|