Package com.batch.android
Class BatchInAppMessage
- java.lang.Object
-
- com.batch.android.BatchMessage
-
- com.batch.android.BatchInAppMessage
-
- All Implemented Interfaces:
InAppMessageUserActionSource,UserActionSource
public class BatchInAppMessage extends BatchMessage implements InAppMessageUserActionSource
A subclass of BatchMessage that represents an In-App message
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceBatchInAppMessage.ContentInterface defining a BatchInAppMessage content model object.-
Nested classes/interfaces inherited from class com.batch.android.BatchMessage
BatchMessage.Format
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringKIND-
Fields inherited from class com.batch.android.BatchMessage
MESSAGING_EXTRA_PAYLOAD_KEY
-
-
Constructor Summary
Constructors Constructor Description BatchInAppMessage(java.lang.String campaignToken, java.lang.String campaignID, JSONObject eventData, JSONObject landingPayload, JSONObject customPayload)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected android.os.BundlegetBundleRepresentation()java.lang.StringgetCampaignToken()Get the campaign token.BatchInAppMessage.ContentgetContent()Get an In-App Message's visual contents.JSONObjectgetCustomPayload()protected JSONObjectgetCustomPayloadInternal()protected JSONObjectgetJSON()protected java.lang.StringgetKind()-
Methods inherited from class com.batch.android.BatchMessage
getFormat, getMessageForBundle, writeToBundle, writeToIntent
-
-
-
-
Field Detail
-
KIND
public static final java.lang.String KIND
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BatchInAppMessage
public BatchInAppMessage(@Nullable java.lang.String campaignToken, @NonNull java.lang.String campaignID, @NonNull JSONObject eventData, @NonNull JSONObject landingPayload, @NonNull JSONObject customPayload)
-
-
Method Detail
-
getJSON
protected JSONObject getJSON()
- Specified by:
getJSONin classBatchMessage
-
getCustomPayloadInternal
protected JSONObject getCustomPayloadInternal()
- Specified by:
getCustomPayloadInternalin classBatchMessage
-
getKind
protected java.lang.String getKind()
- Specified by:
getKindin classBatchMessage
-
getBundleRepresentation
protected android.os.Bundle getBundleRepresentation()
- Specified by:
getBundleRepresentationin classBatchMessage
-
getCustomPayload
@NonNull public JSONObject getCustomPayload()
- Specified by:
getCustomPayloadin interfaceInAppMessageUserActionSource
-
getContent
@Nullable public BatchInAppMessage.Content 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,BatchImageContentorBatchWebViewContent
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
@Nullable public java.lang.String 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.
-
-