Package com.batch.android
Interface Batch.EventDispatcher.Payload
- Enclosing class:
- Batch.EventDispatcher
public static interface Batch.EventDispatcher.Payload
Accessor to the payload of the dispatched event in
BatchEventDispatcher#dispatchEvent(Type, Payload)
.
Declared under Batch.EventDispatcher to avoid ambiguity with BatchEventAttributes
and BatchPushPayload
.-
Method Summary
Modifier and TypeMethodDescriptiongetCustomValue
(String key) Get a value from a key within the custom payload associated with the event.Get the deeplink url associated with the event.Get the raw payload associated with the eventGet the raw payload associated with the eventGet the tracking ID associated with the event.Get the button analytics ID associated with the event.boolean
Indicate if the action associated with the event is positive.
-
Method Details
-
getTrackingId
String getTrackingId()Get the tracking ID associated with the event. Only set for in-app, seeType#isNotificationEvent()
.- Returns:
- the tracking id or null if none is set.
-
getWebViewAnalyticsID
String getWebViewAnalyticsID()Get the button analytics ID associated with the event. Only used for messages of typesType#MESSAGING_WEBVIEW_CLICK
orType#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
String getDeeplink()Get the deeplink url associated with the event. Only set forType#MESSAGING_CLICK
,Type#NOTIFICATION_OPEN
andType#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:
- Whether it is a positive action or not
-
getCustomValue
Get a value from a key within the custom payload associated with the event.- Parameters:
key
- The key of the value to get- Returns:
- the corresponding value or null if none is set.
-
getMessagingPayload
BatchMessage getMessagingPayload()Get the raw payload associated with the event- Returns:
- the payload or null if the event is not a message
-
getPushPayload
BatchPushPayload getPushPayload()Get the raw payload associated with the event- Returns:
- the payload or null if the event is not a push notification
-