public class

RichPushInbox

extends Object
java.lang.Object
   ↳ com.urbanairship.richpush.RichPushInbox

Class Overview

The RichPushInbox singleton provides access to the device's local inbox data. Modifications (e.g., deletions or mark read) will be sent to the Urban Airship server the next time the inbox is synchronized.

Summary

Nested Classes
interface RichPushInbox.Listener A listener interface for receiving event callbacks related to inbox database updates. 
Constants
String MESSAGE_DATA_SCHEME Scheme used for @{code message:} when requesting to view a message with com.urbanairship.VIEW_RICH_PUSH_MESSAGE.
String VIEW_INBOX_INTENT_ACTION Intent action to view the rich push inbox.
String VIEW_MESSAGE_INTENT_ACTION Intent action to view a rich push message.
Public Methods
void addListener(RichPushInbox.Listener listener)
Subscribe a listener for inbox update event callbacks.
void deleteMessages(Set<String> messageIds)
Mark RichPushMessages deleted.
int getCount()
Gets the total message count.
RichPushMessage getMessage(String messageId)
Get the RichPushMessage with the corresponding message ID.
Set<String> getMessageIds()
Gets all the message ids in the inbox.
List<RichPushMessage> getMessages()
Gets a list of RichPushMessages.
int getReadCount()
Gets the total read message count.
List<RichPushMessage> getReadMessages()
Gets a list of read RichPushMessages.
int getUnreadCount()
Gets the total unread message count.
List<RichPushMessage> getUnreadMessages()
Gets a list of unread RichPushMessages.
void markMessagesRead(Set<String> messageIds)
Mark RichPushMessages read in bulk.
void markMessagesUnread(Set<String> messageIds)
Mark RichPushMessages unread in bulk.
void removeListener(RichPushInbox.Listener listener)
Unsubscribe a listener for inbox update event callbacks.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String MESSAGE_DATA_SCHEME

Scheme used for @{code message:} when requesting to view a message with com.urbanairship.VIEW_RICH_PUSH_MESSAGE.

Constant Value: "message"

public static final String VIEW_INBOX_INTENT_ACTION

Intent action to view the rich push inbox.

Constant Value: "com.urbanairship.VIEW_RICH_PUSH_INBOX"

public static final String VIEW_MESSAGE_INTENT_ACTION

Intent action to view a rich push message.

Constant Value: "com.urbanairship.VIEW_RICH_PUSH_MESSAGE"

Public Methods

public void addListener (RichPushInbox.Listener listener)

Subscribe a listener for inbox update event callbacks.

Parameters
listener An object implementing the RichPushInbox.Listener interface.

public void deleteMessages (Set<String> messageIds)

Mark RichPushMessages 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.

Parameters
messageIds A set of message ids.

public int getCount ()

Gets the total message count.

Returns
  • The number of RichPushMessages currently in the inbox.

public RichPushMessage getMessage (String messageId)

Get the RichPushMessage with the corresponding message ID.

Parameters
messageId The message ID of the desired RichPushMessage.
Returns

public Set<String> getMessageIds ()

Gets all the message ids in the inbox.

Returns
  • A set of message ids.

public List<RichPushMessage> getMessages ()

Gets a list of RichPushMessages. Sorted by descending sent at date.

Returns

public int getReadCount ()

Gets the total read message count.

Returns
  • The number of read RichPushMessages currently in the inbox.

public List<RichPushMessage> getReadMessages ()

Gets a list of read RichPushMessages. Sorted by descending sent at date.

Returns

public int getUnreadCount ()

Gets the total unread message count.

Returns
  • The number of unread RichPushMessages currently in the inbox.

public List<RichPushMessage> getUnreadMessages ()

Gets a list of unread RichPushMessages. Sorted by descending sent at date.

Returns

public void markMessagesRead (Set<String> messageIds)

Mark RichPushMessages read in bulk.

Parameters
messageIds A set of message ids.

public void markMessagesUnread (Set<String> messageIds)

Mark RichPushMessages unread in bulk.

Parameters
messageIds A set of message ids.

public void removeListener (RichPushInbox.Listener listener)

Unsubscribe a listener for inbox update event callbacks.

Parameters
listener An object implementing the RichPushInbox.Listener interface.