Class MessagingEventPayload
- java.lang.Object
-
- com.batch.android.eventdispatcher.MessagingEventPayload
-
- All Implemented Interfaces:
Batch.EventDispatcher.Payload
public class MessagingEventPayload extends java.lang.Object implements Batch.EventDispatcher.Payload
Payload accessor for aBatch.EventDispatcher.Type.MESSAGING_SHOWand other MESSAGING events.
-
-
Constructor Summary
Constructors Constructor Description MessagingEventPayload(BatchMessage message, JSONObject payload, JSONObject customPayload)MessagingEventPayload(BatchMessage message, JSONObject payload, JSONObject customPayload, Action action)MessagingEventPayload(BatchMessage message, JSONObject payload, JSONObject customPayload, Action action, java.lang.String buttonAnalyticsId)
-
Method Summary
All Methods Instance Methods Concrete 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.
-
-
-
Constructor Detail
-
MessagingEventPayload
public MessagingEventPayload(BatchMessage message, JSONObject payload, JSONObject customPayload)
-
MessagingEventPayload
public MessagingEventPayload(BatchMessage message, JSONObject payload, JSONObject customPayload, Action action, java.lang.String buttonAnalyticsId)
-
MessagingEventPayload
public MessagingEventPayload(BatchMessage message, JSONObject payload, JSONObject customPayload, Action action)
-
-
Method Detail
-
getTrackingId
@Nullable public java.lang.String getTrackingId()
Description copied from interface:Batch.EventDispatcher.PayloadGet the tracking ID associated with the event. Only set for in-app, seeBatch.EventDispatcher.Type.isNotificationEvent().- Specified by:
getTrackingIdin interfaceBatch.EventDispatcher.Payload- Returns:
- the tracking id or null if none is set.
-
getWebViewAnalyticsID
@Nullable public java.lang.String getWebViewAnalyticsID()
Description copied from interface:Batch.EventDispatcher.PayloadGet 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.- Specified by:
getWebViewAnalyticsIDin interfaceBatch.EventDispatcher.Payload- Returns:
- the button analytics ID or null if none is available.
-
getDeeplink
@Nullable public java.lang.String getDeeplink()
Description copied from interface:Batch.EventDispatcher.PayloadGet the deeplink url associated with the event. Only set forBatch.EventDispatcher.Type.MESSAGING_CLICK,Batch.EventDispatcher.Type.NOTIFICATION_OPENandBatch.EventDispatcher.Type.NOTIFICATION_DISPLAY- Specified by:
getDeeplinkin interfaceBatch.EventDispatcher.Payload- Returns:
- the deeplink for the event or null if none is available.
-
isPositiveAction
public boolean isPositiveAction()
Description copied from interface:Batch.EventDispatcher.PayloadIndicate 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- Specified by:
isPositiveActionin interfaceBatch.EventDispatcher.Payload- Returns:
-
getCustomValue
@Nullable public java.lang.String getCustomValue(@NonNull java.lang.String key)Description copied from interface:Batch.EventDispatcher.PayloadGet a value from a key within the custom payload associated with the event.- Specified by:
getCustomValuein interfaceBatch.EventDispatcher.Payload- Returns:
- the corresponding value or null if none is set.
-
getMessagingPayload
@Nullable public BatchMessage getMessagingPayload()
Description copied from interface:Batch.EventDispatcher.PayloadGet the raw payload associated with the event- Specified by:
getMessagingPayloadin interfaceBatch.EventDispatcher.Payload- Returns:
- the payload or null if the event is not a message
-
getPushPayload
@Nullable public BatchPushPayload getPushPayload()
Description copied from interface:Batch.EventDispatcher.PayloadGet the raw payload associated with the event- Specified by:
getPushPayloadin interfaceBatch.EventDispatcher.Payload- Returns:
- the payload or null if the event is not a push notification
-
-