pushNotificationWasSentFromHurree

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 null as map, and for FCM we are going to get a map in response then we pass null as bundle.

This feature gives backwards compatibility for existing GCM users.

Method Signature

boolean pushNotificationWasSentFromHurree(Bundle gcmData, Map<String, String> fcmData)

To add the method

  1. Open your project.
  2. Open app > src > main > java > package name > MyFirebaseMessagingService.
  3. Add the method code: Method Code

Arguments

These are the arguments that define the method.

Name Type Mandatory Description
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.

Sample Code

Analytics.getInstance(this).pushNotificationWasSentFromHurree(null, fcmData);

results matching ""

    No results matching ""