Class BatchMessage

java.lang.Object
com.batch.android.BatchMessage
All Implemented Interfaces:
UserActionSource
Direct Known Subclasses:
BatchInAppMessage, BatchLandingMessage

public abstract class BatchMessage extends Object implements UserActionSource
Model representing a Batch Messaging message.
  • Field Details

    • MESSAGING_EXTRA_PAYLOAD_KEY

      public static final String 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

      protected abstract JSONObject getJSON()
    • writeToBundle

      public void writeToBundle(Bundle bundle)
    • writeToIntent

      public void writeToIntent(Intent intent)
    • getMessageForBundle

      public static BatchMessage getMessageForBundle(Bundle bundle) throws BatchPushPayload.ParsingException
      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 String getKind()
    • getBundleRepresentation

      protected abstract Bundle getBundleRepresentation()