public class

RichPushManager

extends BaseManager
java.lang.Object
   ↳ com.urbanairship.BaseManager
     ↳ com.urbanairship.richpush.RichPushManager

Class Overview

This class is the primary interface for Rich Push functionality.

Summary

Nested Classes
interface RichPushManager.Listener A listener interface for receiving event callbacks related to inbox and user updates. 
interface RichPushManager.RefreshMessagesCallback A callback used to be notified when refreshing messages. 
Constants
String RICH_PUSH_KEY The rich push extra that contains the rich push message ID.
Public Methods
void addListener(RichPushManager.Listener listener)
Subscribe a listener for inbox and user update event callbacks.
synchronized RichPushInbox getRichPushInbox()
Get the RichPushInbox.
synchronized RichPushUser getRichPushUser()
Get the RichPushUser.
boolean isRefreshingMessages()
Indicates whether messages are currently being retrieved from the server.
static boolean isRichPushMessage(Map<StringString> extras)
Indicates whether a push belongs to a Rich Push message.
static boolean isRichPushMessage(Bundle extras)
Indicates whether a push belongs to a Rich Push message.
void refreshMessages()
Sync the messages on the device with what's on the server.
void refreshMessages(RichPushManager.RefreshMessagesCallback callback)
Sync the messages on the device with what's on the server.
void refreshMessages(boolean force)
Sync the messages on the device with what's on the server.
void removeListener(RichPushManager.Listener listener)
Unsubscribe a listener for inbox and user update event callbacks.
void updateUser()
This method is deprecated. Marked to be removed in 7.0.0. Use updateUser(true) instead.
void updateUser(boolean forcefully)
Updates the user on the device with what's on the server.
void updateUserIfNecessary()
This method is deprecated. Marked to be removed in 7.0.0. Use updateUser(false) instead.
Protected Methods
void init()
Initialize the manager.
void tearDown()
Tear down the manager.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String RICH_PUSH_KEY

The rich push extra that contains the rich push message ID.

Constant Value: "_uamid"

Public Methods

public void addListener (RichPushManager.Listener listener)

Subscribe a listener for inbox and user update event callbacks.

Parameters
listener An object implementing the RichPushManager.Listener interface.

public synchronized RichPushInbox getRichPushInbox ()

Get the RichPushInbox.

Returns

public synchronized RichPushUser getRichPushUser ()

Get the RichPushUser.

Returns

public boolean isRefreshingMessages ()

Indicates whether messages are currently being retrieved from the server.

Returns
  • true if a refresh is in progress, false otherwise.

public static boolean isRichPushMessage (Map<StringString> extras)

Indicates whether a push belongs to a Rich Push message.

This is used for incoming push messages.

Parameters
extras Push message extras.
Returns
  • true if the extras belong to a rich push message, false otherwise.

public static boolean isRichPushMessage (Bundle extras)

Indicates whether a push belongs to a Rich Push message.

This is used for determining whether an opened notification is a rich push message.

Parameters
extras Notification Intent extras.
Returns
  • true if the extras belong to a rich push message, false otherwise.

public void refreshMessages ()

Sync the messages on the device with what's on the server.

The inbox should be updated automatically.

public void refreshMessages (RichPushManager.RefreshMessagesCallback callback)

Sync the messages on the device with what's on the server.

The inbox should be updated automatically.

Note: The listeners will be called after all of the refresh message requests are finished, while the callback will be called after this particular refresh messages request is finished.

Parameters
callback Callback to be notified when the request finishes refreshing the messages.

public void refreshMessages (boolean force)

Sync the messages on the device with what's on the server.

The inbox should be updated automatically.

Parameters
force true to refresh messages even if messages are being refreshed.

public void removeListener (RichPushManager.Listener listener)

Unsubscribe a listener for inbox and user update event callbacks.

Parameters
listener An object implementing the RichPushManager.Listener interface.

public void updateUser ()

This method is deprecated.
Marked to be removed in 7.0.0. Use updateUser(true) instead.

Sync the user on the device with what's on the server.

public void updateUser (boolean forcefully)

Updates the user on the device with what's on the server.

Parameters
forcefully A boolean indicating if the rich push user needs to be updated.

public void updateUserIfNecessary ()

This method is deprecated.
Marked to be removed in 7.0.0. Use updateUser(false) instead.

Updates the user if the user has not been updated in the last 24hrs.

Protected Methods

protected void init ()

Initialize the manager. Called in UAirship during takeoff.

protected void tearDown ()

Tear down the manager. Called in UAirship during land.