To start using the App Inbox feature, first make sure you have followed the integration guide.
The App Inbox is a great feature to keep all the messages in one place, allowing users to read messages even after they have dismissed a notification. Your application is in charge of managing and displaying the messages.
An App Inbox message is a simple class proxy that only exposes the required information like the title, content, and the message read status. An App Inbox message can be actionable, meaning it can perform an action when selected, like opening a deep link or display an image. Executing a message action will mark the message as read.
The App Inbox provides a simple API for accessing the messages, removing them or change their status.
For example, the
getUnreadMessageCount can be used to display a badge with the number of messages that
require the users's attention.
To display the App Inbox messages, you could for example use a
RecyclerView with a basic cell
showing the title and subtitle. Set the text font weight to bold when unread. When user selects a row that
is actionable, just call the
The sample application available on Github here shows a simple RecyclerView implementation.
Handling App Inbox Events
You can register to broadcast intents sent by the App Inbox when a message is added to the inbox, read (from notification), or has expired.
The broadcast intent with action
APP_INBOX_ACTION comes with 2 extra fields:
APP_INBOX_EVENT_EXTRA: (String) The event type (added, read, expired)
APP_INBOX_UNREAD_EXTRA: (long) The number of unread messages after the event occured