Package com.batch.android
Class BatchMessage
- java.lang.Object
-
- com.batch.android.BatchMessage
-
- All Implemented Interfaces:
UserActionSource
- Direct Known Subclasses:
BatchInAppMessage,BatchLandingMessage
public abstract class BatchMessage extends java.lang.Object implements UserActionSource
Model representing a Batch Messaging message.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBatchMessage.FormatFormats that can be contained into a BatchMessage.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringMESSAGING_EXTRA_PAYLOAD_KEYKey to retrieve the messaging payload (if applicable) from an extra
-
Constructor Summary
Constructors Constructor Description BatchMessage()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract android.os.BundlegetBundleRepresentation()protected abstract JSONObjectgetCustomPayloadInternal()BatchMessage.FormatgetFormat()Returns the format of the displayable message, if any.protected abstract JSONObjectgetJSON()protected abstract java.lang.StringgetKind()static BatchMessagegetMessageForBundle(android.os.Bundle bundle)voidwriteToBundle(android.os.Bundle bundle)voidwriteToIntent(android.content.Intent intent)
-
-
-
Field Detail
-
MESSAGING_EXTRA_PAYLOAD_KEY
public static final java.lang.String MESSAGING_EXTRA_PAYLOAD_KEY
Key to retrieve the messaging payload (if applicable) from an extra- See Also:
- Constant Field Values
-
-
Method Detail
-
getJSON
protected abstract JSONObject getJSON()
-
getCustomPayloadInternal
protected abstract JSONObject getCustomPayloadInternal()
-
writeToBundle
public void writeToBundle(@NonNull android.os.Bundle bundle)
-
writeToIntent
public void writeToIntent(@NonNull android.content.Intent intent)
-
getMessageForBundle
public static BatchMessage getMessageForBundle(@NonNull android.os.Bundle bundle) throws BatchPushPayload.ParsingException
-
getFormat
public BatchMessage.Format getFormat()
Returns the format of the displayable message, if any.You should cache this result rather than access the getter multiple times, as it involves some computation.
Note: This getter bypasses most of the checks of the message's internal representation. Having a valid format returned here does not mean that other operations (such as
Batch.Messaging.loadFragment(Context, BatchMessage)) will succeed.- Returns:
- the format of the displayable message, if any.
-
getKind
protected abstract java.lang.String getKind()
-
getBundleRepresentation
protected abstract android.os.Bundle getBundleRepresentation()
-
-