Package com.batch.android
Class BatchInAppMessage
java.lang.Object
com.batch.android.BatchMessage
com.batch.android.BatchInAppMessage
- All Implemented Interfaces:
InAppMessageUserActionSource
,UserActionSource
A subclass of BatchMessage that represents an In-App message
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Interface defining a BatchInAppMessage content model object.Nested classes/interfaces inherited from class com.batch.android.BatchMessage
BatchMessage.Format
-
Field Summary
Fields inherited from class com.batch.android.BatchMessage
MESSAGING_EXTRA_PAYLOAD_KEY
-
Constructor Summary
ConstructorDescriptionBatchInAppMessage
(String campaignToken, String campaignID, JSONObject eventData, JSONObject landingPayload, JSONObject customPayload) -
Method Summary
Modifier and TypeMethodDescriptionprotected Bundle
Get the campaign token.Get an In-App Message's visual contents.protected JSONObject
getJSON()
protected String
getKind()
Methods inherited from class com.batch.android.BatchMessage
getFormat, getMessageForBundle, writeToBundle, writeToIntent
-
Field Details
-
KIND
- See Also:
-
-
Constructor Details
-
BatchInAppMessage
public BatchInAppMessage(String campaignToken, String campaignID, JSONObject eventData, JSONObject landingPayload, JSONObject customPayload)
-
-
Method Details
-
getJSON
- Specified by:
getJSON
in classBatchMessage
-
getKind
- Specified by:
getKind
in classBatchMessage
-
getBundleRepresentation
- Specified by:
getBundleRepresentation
in classBatchMessage
-
getCustomPayload
- Specified by:
getCustomPayload
in interfaceInAppMessageUserActionSource
-
getContent
Get an In-App Message's visual contents.
Since an In-App message's contents can change a lot between formats, you will need to cast this to one of the classes implementing
BatchInAppMessage.Content
, such asBatchAlertContent
,BatchInterstitialContent
,BatchBannerContent
,BatchImageContent
orBatchWebViewContent
More types might be added in the future, so don't make any assumptions on the instance returned.- Returns:
- The In-App message's visual contents. Can be null if an error occurred or if not applicable
-
getCampaignToken
Get the campaign token. This is the same token as you see when opening the In-App Campaign in your browser, when on the dashboard.Can be null.
-