Package com.batch.android
Class BatchMessage
java.lang.Object
com.batch.android.BatchMessage
- All Implemented Interfaces:
UserActionSource
- Direct Known Subclasses:
BatchInAppMessage,BatchLandingMessage
Model representing a Batch Messaging message.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumFormats that can be contained into a BatchMessage. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringKey to retrieve the messaging payload (if applicable) from an extra -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract BundleReturns the format of the displayable message, if any.protected abstract JSONObjectgetJSON()protected abstract StringgetKind()static BatchMessagegetMessageForBundle(Bundle bundle) voidwriteToBundle(Bundle bundle) voidwriteToIntent(Intent intent)
-
Field Details
-
MESSAGING_EXTRA_PAYLOAD_KEY
Key to retrieve the messaging payload (if applicable) from an extra- See Also:
-
-
Constructor Details
-
BatchMessage
public BatchMessage()
-
-
Method Details
-
getJSON
-
writeToBundle
-
writeToIntent
-
getMessageForBundle
public static BatchMessage getMessageForBundle(Bundle bundle) throws BatchPushPayload.ParsingException -
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
-
getBundleRepresentation
-