java.lang.Object | |
↳ | com.urbanairship.messagecenter.Inbox |
The inbox provides access to the device's local inbox data. Modifications (e.g., deletions or mark read) will be sent to the Airship server the next time the inbox is synchronized.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
interface | Inbox.FetchMessagesCallback | A callback used to be notified when refreshing messages. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
addListener(InboxListener listener)
Subscribe a listener for inbox update event callbacks.
| ||||||||||
void |
deleteMessages(Set<String> messageIds)
Mark
Message s deleted. | ||||||||||
Cancelable |
fetchMessages(Inbox.FetchMessagesCallback callback)
Fetches the latest inbox changes from Airship.
| ||||||||||
void |
fetchMessages()
Fetches the latest inbox changes from Airship.
| ||||||||||
Cancelable |
fetchMessages(Looper looper, Inbox.FetchMessagesCallback callback)
Fetches the latest inbox changes from Airship.
| ||||||||||
int |
getCount()
Gets the total message count.
| ||||||||||
Message |
getMessage(String messageId)
Get the
Message with the corresponding message ID. | ||||||||||
Message |
getMessageByUrl(String messageUrl)
Get the
Message with the corresponding message body URL. | ||||||||||
Set<String> |
getMessageIds()
Gets all the message ids in the inbox.
| ||||||||||
List<Message> |
getMessages(Predicate<Message> predicate)
Gets a list of RichPushMessages, filtered by the provided predicate.
| ||||||||||
List<Message> |
getMessages()
Gets a list of RichPushMessages.
| ||||||||||
int |
getReadCount()
Gets the total read message count.
| ||||||||||
List<Message> |
getReadMessages()
Gets a list of read RichPushMessages.
| ||||||||||
List<Message> |
getReadMessages(Predicate<Message> predicate)
Gets a list of read RichPushMessages, filtered by the provided predicate.
| ||||||||||
int |
getUnreadCount()
Gets the total unread message count.
| ||||||||||
List<Message> |
getUnreadMessages()
Gets a list of unread RichPushMessages.
| ||||||||||
List<Message> |
getUnreadMessages(Predicate<Message> predicate)
Gets a list of unread RichPushMessages, filtered by the provided predicate.
| ||||||||||
User |
getUser()
Returns the
User . | ||||||||||
void |
markMessagesRead(Set<String> messageIds)
Mark
Message s read in bulk. | ||||||||||
void |
markMessagesUnread(Set<String> messageIds)
Mark
Message s unread in bulk. | ||||||||||
void |
removeListener(InboxListener listener)
Unsubscribe a listener for inbox update event callbacks.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Subscribe a listener for inbox update event callbacks.
listener | An object implementing the InboxListener interface.
|
---|
Mark Message
s deleted.
Note that in most cases these messages aren't immediately deleted on the server, but they will be inaccessible on the device as soon as they're marked deleted.
messageIds | A set of message ids. |
---|
Fetches the latest inbox changes from Airship.
Normally this method is not called directly as the message list is automatically fetched when the application foregrounds or when a notification with an associated message is received.
If the fetch request completes and results in a change to the messages,
onInboxUpdated()
will be called.
callback | Callback to be notified when the request finishes fetching the messages. |
---|
Fetches the latest inbox changes from Airship.
Normally this method is not called directly as the message list is automatically fetched when the application foregrounds or when a notification with an associated message is received.
If the fetch request completes and results in a change to the messages,
onInboxUpdated()
will be called.
Fetches the latest inbox changes from Airship.
Normally this method is not called directly as the message list is automatically fetched when the application foregrounds or when a notification with an associated message is received.
If the fetch request completes and results in a change to the messages,
onInboxUpdated()
will be called.
looper | The looper to post the callback on. |
---|---|
callback | Callback to be notified when the request finishes fetching the messages. |
Gets the total message count.
Gets all the message ids in the inbox.
Gets a list of RichPushMessages, filtered by the provided predicate. Sorted by descending sent-at date.
predicate | A predicate for filtering messages. If null, no predicate will be applied. |
---|
Message
s.
Gets a list of RichPushMessages. Sorted by descending sent-at date.
Message
s.
Gets the total read message count.
Gets a list of read RichPushMessages. Sorted by descending sent-at date.
Message
s.
Gets a list of read RichPushMessages, filtered by the provided predicate. Sorted by descending sent-at date.
predicate | A predicate for filtering messages. If null, no predicate will be applied. |
---|
Message
s.
Gets the total unread message count.
Gets a list of unread RichPushMessages. Sorted by descending sent-at date.
Message
s.
Gets a list of unread RichPushMessages, filtered by the provided predicate. Sorted by descending sent-at date.
predicate | A predicate for filtering messages. If null, no predicate will be applied. |
---|
Message
s.
Mark Message
s read in bulk.
messageIds | A set of message ids. |
---|
Mark Message
s unread in bulk.
messageIds | A set of message ids. |
---|
Unsubscribe a listener for inbox update event callbacks.
listener | An object implementing the InboxListener interface.
|
---|