Package com.batch.android
Interface Batch.EventDispatcher.Payload
-
- All Known Implementing Classes:
MessagingEventPayload,PushEventPayload
- Enclosing class:
- Batch.EventDispatcher
public static interface Batch.EventDispatcher.PayloadAccessor to the payload of the dispatched event inBatchEventDispatcher.dispatchEvent(Type, Payload). Declared under Batch.EventDispatcher to avoid ambiguity withBatchEventDataandBatchPushPayload.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetCustomValue(java.lang.String key)Get a value from a key within the custom payload associated with the event.java.lang.StringgetDeeplink()Get the deeplink url associated with the event.BatchMessagegetMessagingPayload()Get the raw payload associated with the eventBatchPushPayloadgetPushPayload()Get the raw payload associated with the eventjava.lang.StringgetTrackingId()Get the tracking ID associated with the event.java.lang.StringgetWebViewAnalyticsID()Get the button analytics ID associated with the event.booleanisPositiveAction()Indicate if the action associated with the event is positive.
-
-
-
Method Detail
-
getTrackingId
@Nullable java.lang.String getTrackingId()
Get the tracking ID associated with the event. Only set for in-app, seeBatch.EventDispatcher.Type.isNotificationEvent().- Returns:
- the tracking id or null if none is set.
-
getWebViewAnalyticsID
@Nullable java.lang.String getWebViewAnalyticsID()
Get the button analytics ID associated with the event. Only used for messages of typesBatch.EventDispatcher.Type.MESSAGING_WEBVIEW_CLICKorBatch.EventDispatcher.Type.MESSAGING_CLOSE. Matches the "analyticsID" parameter of various methods of the JavaScript SDK.- Returns:
- the button analytics ID or null if none is available.
-
getDeeplink
@Nullable java.lang.String getDeeplink()
Get the deeplink url associated with the event. Only set forBatch.EventDispatcher.Type.MESSAGING_CLICK,Batch.EventDispatcher.Type.NOTIFICATION_OPENandBatch.EventDispatcher.Type.NOTIFICATION_DISPLAY- Returns:
- the deeplink for the event or null if none is available.
-
isPositiveAction
boolean isPositiveAction()
Indicate if the action associated with the event is positive. A positive action is : - An Open for a push campaign - A CTA click or Global tap containing a deeplink or a custom action for a messaging campaign- Returns:
-
getCustomValue
@Nullable java.lang.String getCustomValue(@NonNull java.lang.String key)Get a value from a key within the custom payload associated with the event.- Parameters:
key-- Returns:
- the corresponding value or null if none is set.
-
getMessagingPayload
@Nullable BatchMessage getMessagingPayload()
Get the raw payload associated with the event- Returns:
- the payload or null if the event is not a message
-
getPushPayload
@Nullable BatchPushPayload getPushPayload()
Get the raw payload associated with the event- Returns:
- the payload or null if the event is not a push notification
-
-