public class

MessageCenter

extends AirshipComponent
java.lang.Object
   ↳ com.urbanairship.AirshipComponent
     ↳ com.urbanairship.messagecenter.MessageCenter

Class Overview

Airship Message Center.

Summary

Nested Classes
interface MessageCenter.OnShowMessageCenterListener Listener for showing the message center. 
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_MESSAGE_CENTER_INTENT_ACTION Intent action to view the message center.
String VIEW_MESSAGE_INTENT_ACTION Intent action to view a message.
Public Methods
Inbox getInbox()
Returns the inbox.
Predicate<Message> getPredicate()
Returns the default inbox predicate.
User getUser()
Returns the inbox user.
boolean onAirshipDeepLink(Uri uri)
Called to handle `uairship://` deep links.
static String parseMessageId(Intent intent)
Parses the message Id from a message center intent.
void setOnShowMessageCenterListener(MessageCenter.OnShowMessageCenterListener listener)
Sets the show message center listener.
void setPredicate(Predicate<Message> predicate)
Sets the default inbox predicate.
static MessageCenter shared()
Gets the shared Message Center instance.
void showMessageCenter(String messageId)
Called to show the message center for a specific message.
void showMessageCenter()
Called to show the message center.
[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_MESSAGE_CENTER_INTENT_ACTION

Intent action to view the message center.

Constant Value: "com.urbanairship.VIEW_RICH_PUSH_INBOX"

public static final String VIEW_MESSAGE_INTENT_ACTION

Intent action to view a message.

Constant Value: "com.urbanairship.VIEW_RICH_PUSH_MESSAGE"

Public Methods

public Inbox getInbox ()

Returns the inbox.

Returns
  • The inbox.

public Predicate<Message> getPredicate ()

Returns the default inbox predicate.

Returns
  • The default inbox predicate.

public User getUser ()

Returns the inbox user.

Returns
  • The inbox user.

public boolean onAirshipDeepLink (Uri uri)

Called to handle `uairship://` deep links.

Parameters
uri The deep link.
Returns
  • true if the deep link was handled, otherwise false.

public static String parseMessageId (Intent intent)

Parses the message Id from a message center intent.

Parameters
intent The intent.
Returns
  • The message Id if it's available on the intent, otherwise null.

public void setOnShowMessageCenterListener (MessageCenter.OnShowMessageCenterListener listener)

Sets the show message center listener.

Parameters
listener The listener.

public void setPredicate (Predicate<Message> predicate)

Sets the default inbox predicate.

Parameters
predicate The default inbox predicate.

public static MessageCenter shared ()

Gets the shared Message Center instance.

Returns
  • The shared Message Center instance.

public void showMessageCenter (String messageId)

Called to show the message center for a specific message. To show the message center, the SDK will try the following:

 - The optional MessageCenter.OnShowMessageCenterListener.
 - An implicit intent with com.urbanairship.VIEW_RICH_PUSH_INBOX.
 - If the message ID is provided, an implicit intent with com.urbanairship.VIEW_MESSAGE_INTENT_ACTION.
 - Finally it will fallback to the provided MessageCenterActivity.
 
Implicit intents will have the message ID encoded as the intent's data with the format @{code message:}.

Parameters
messageId The message ID.

public void showMessageCenter ()

Called to show the message center. See showMessageCenter(String) for more details.