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
Modifier and TypeClassDescriptionstatic enum
Formats that can be contained into a BatchMessage. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Key to retrieve the messaging payload (if applicable) from an extra -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Bundle
Returns the format of the displayable message, if any.protected abstract JSONObject
getJSON()
protected abstract String
getKind()
static BatchMessage
getMessageForBundle
(Bundle bundle) void
writeToBundle
(Bundle bundle) void
writeToIntent
(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
-