-
public interface INotificationLifecycleServiceProvides for both internal and external events and decision callbacks into the notification lifecycle. There are a total of 5 callbacks/handlers:
Internal
--------INotificationLifecycleCallback: Can be used by other modules to use push notifications to drive their own processing, and prevent it from being received and/or opened by the user.
External
--------INotificationServiceExtension: Callback to indicate a notification has been received. Specified in the AndroidManifest.xml. INotificationLifecycleListener: Callback to indicate a notification has been received while the app is in the foreground. INotificationClickListener: Callback to indicate a notification has been opened.
The order of events is as follows
Notification is received by the notification module
INotificationLifecycleCallback.canReceiveNotification To determine if the notification can be received by the notification module, or should be ignored.
INotificationServiceExtension.onNotificationReceived To pre-process the notification, notification may be removed/changed. (Specified in AndroidManifest.xml).
INotificationLifecycleListener.onWillDisplay To pre-process the notification while app in foreground, notification may be removed/changed.
Process/Display the notification
User "opens" or "dismisses" the notification
INotificationLifecycleCallback.canOpenNotification To determine if the notification can be opened by the notification module, or should be ignored.
INotificationClickListener.onClick To indicate the notification has been opened.
-
-
Method Summary
Modifier and Type Method Description abstract UnitsetInternalNotificationLifecycleCallback(INotificationLifecycleCallback callback)abstract UnitaddExternalForegroundLifecycleListener(INotificationLifecycleListener listener)abstract UnitremoveExternalForegroundLifecycleListener(INotificationLifecycleListener listener)abstract UnitaddExternalClickListener(INotificationClickListener listener)abstract UnitremoveExternalClickListener(INotificationClickListener listener)abstract BooleancanReceiveNotification(JSONObject jsonPayload)abstract UnitexternalRemoteNotificationReceived(INotificationReceivedEvent notificationReceivedEvent)abstract UnitexternalNotificationWillShowInForeground(INotificationWillDisplayEvent willDisplayEvent)abstract UnitnotificationReceived(NotificationGenerationJob notificationJob)abstract BooleancanOpenNotification(Activity activity, JSONObject data)abstract UnitnotificationOpened(Activity activity, JSONArray data)-
-
Method Detail
-
setInternalNotificationLifecycleCallback
abstract Unit setInternalNotificationLifecycleCallback(INotificationLifecycleCallback callback)
-
addExternalForegroundLifecycleListener
abstract Unit addExternalForegroundLifecycleListener(INotificationLifecycleListener listener)
-
removeExternalForegroundLifecycleListener
abstract Unit removeExternalForegroundLifecycleListener(INotificationLifecycleListener listener)
-
addExternalClickListener
abstract Unit addExternalClickListener(INotificationClickListener listener)
-
removeExternalClickListener
abstract Unit removeExternalClickListener(INotificationClickListener listener)
-
canReceiveNotification
abstract Boolean canReceiveNotification(JSONObject jsonPayload)
-
externalRemoteNotificationReceived
abstract Unit externalRemoteNotificationReceived(INotificationReceivedEvent notificationReceivedEvent)
-
externalNotificationWillShowInForeground
abstract Unit externalNotificationWillShowInForeground(INotificationWillDisplayEvent willDisplayEvent)
-
notificationReceived
abstract Unit notificationReceived(NotificationGenerationJob notificationJob)
-
canOpenNotification
abstract Boolean canOpenNotification(Activity activity, JSONObject data)
-
notificationOpened
abstract Unit notificationOpened(Activity activity, JSONArray data)
-
-
-
-