Package com.batch.android
Class BatchInboxNotificationContent
java.lang.Object
com.batch.android.BatchInboxNotificationContent
BatchInboxNotificationContent is a model representing the content of an inbox notification
-
Method Summary
Modifier and TypeMethodDescriptionvoid
displayLandingMessage
(Context context) Display the landing message attached to a BatchInboxNotificationContent.getBody()
getDate()
Unique identifier for this notification.GetBatchPushPayload
instance, property initialized with the notification's original push payloadGet the payload in its raw JSON form.getTitle()
boolean
Whether the notification content has a landing message attachedboolean
isSilent()
Returns whether Batch considers this a silent notification.boolean
isUnread()
-
Method Details
-
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
-
getBody
-
getSource
-
isUnread
public boolean isUnread() -
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
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, callBatchPushPayload#getPushBundle()
on the instance given bygetPushPayload()
. -
getPushPayload
GetBatchPushPayload
instance, property initialized with the notification's original push payload -
hasLandingMessage
public boolean hasLandingMessage()Whether the notification content has a landing message attached- Returns:
- true if a landing message is attached
-
displayLandingMessage
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.
-