Class BatchInboxNotificationContent

java.lang.Object
com.batch.android.BatchInboxNotificationContent

public class BatchInboxNotificationContent extends Object
BatchInboxNotificationContent is a model representing the content of an inbox notification
  • Method Details

    • getNotificationIdentifier

      public String getNotificationIdentifier()
      Unique identifier for this notification.
      Returns:
      The unique notification identifier. Do not make assumptions about its format: it can change at any time.
    • getTitle

      public String getTitle()
    • getBody

      public String getBody()
    • getSource

      public BatchNotificationSource getSource()
    • isUnread

      public boolean isUnread()
    • isDeleted

      @Deprecated public boolean isDeleted()
      Deprecated.
      You should refresh your copy of the data with getFetchedNotifications() after using markAsDeleted.
      Flag indicating whether this notification is deleted or not.
      Returns:
      true if notification is deleted
    • getDate

      public Date getDate()
    • isSilent

      public boolean isSilent()
      Returns whether Batch considers this a silent notification. A silent notification is a notification with no title and message, which won't be displayed by Batch SDK. Warning: Other services listening to push messages might display it.
    • getRawPayload

      public Map<String,String> getRawPayload()
      Get the payload in its raw JSON form. This might differ from what you're used to in other classes handling push payloads. If you want to simulate the push behaviour, call BatchPushPayload#getPushBundle() on the instance given by getPushPayload() .
    • getPushPayload

      public BatchPushPayload getPushPayload() throws BatchPushPayload.ParsingException
      Get BatchPushPayload instance, property initialized with the notification's original push payload
      Throws:
      BatchPushPayload.ParsingException
    • hasLandingMessage

      public boolean hasLandingMessage()
      Whether the notification content has a landing message attached
      Returns:
      true if a landing message is attached
    • displayLandingMessage

      public void displayLandingMessage(Context context)
      Display the landing message attached to a BatchInboxNotificationContent. Do nothing if no message is attached.

      Note that this method will work even if Batch is in do not disturb mode.

      The given context should be an Activity instance to enable support for the banner format, as it has to be attached to an activity.

      Parameters:
      context - Your activity's context, Can't be null.