public class InboxManager
extends java.lang.Object
implements android.arch.lifecycle.LifecycleObserver
InboxManager class collects all of the APIs related to the inbox. Inbox features
include resolving (i.e. responding to/addressing) an InboxEntity object (i.e. a message),
retrieving the List of InboxEntity objects, both resolved and unresolved, and
getting the unread message count. The inbox features are only available when used in conjunction
with MicroStrategy Communicator. All of these methods will be executed on a background thread
and return the result on the main thread. To receive the result, you are expected to pass a
corresponding SingleCallback.
To retrieve the List of InboxEntity objects for all badges on a device, call
get(boolean, boolean, SingleCallback) and provide whether you want the
unresolved/resolved items and whether you want the messages to be fetched directly from the
server or retrieved from the cache.
To resolve a message, call resolve(InboxEntity, CompleteCallback) with the message you
want to address. There are two types of messages that InboxEntity objects encapsulate:
generic and two-way. Generic messages only allow the receiver to confirm receipt of the message.
Two-way messages allow the receiver to choose an option defined by the sender as a response.
To get the number of new messages (i.e. messages that have not been replied to), call
count(SingleCallback). This will return the number of unresolved InboxEntity
objects for all badges on a device.
| Constructor and Description |
|---|
InboxManager(android.support.v7.app.AppCompatActivity appCompatActivity)
Constructor for an
InboxManager with the lifecycle set. |
InboxManager(android.support.v4.app.Fragment fragment)
Constructor for an
InboxManager with the lifecycle set. |
InboxManager(android.arch.lifecycle.Lifecycle lifecycle)
Constructor for an
InboxManager with the lifecycle set. |
| Modifier and Type | Method and Description |
|---|---|
void |
count(SingleCallback<java.lang.Integer> callback)
Returns an int of the number of new
InboxEntity objects for all badges on a
device. |
void |
get(boolean unresolved,
boolean forceRefresh,
SingleCallback<java.util.List<InboxEntity>> callback)
Returns a
List of InboxEntity objects for all badges on a device. |
void |
resolve(InboxEntity inboxEntity,
CompleteCallback callback)
Returns a
CompleteCallback after resolving (i.e. |
public InboxManager(android.arch.lifecycle.Lifecycle lifecycle)
InboxManager with the lifecycle set.lifecycle - See Lifecyclepublic InboxManager(android.support.v7.app.AppCompatActivity appCompatActivity)
InboxManager with the lifecycle set.appCompatActivity - See AppCompatActivitypublic InboxManager(android.support.v4.app.Fragment fragment)
InboxManager with the lifecycle set.fragment - See Fragmentpublic void resolve(InboxEntity inboxEntity, CompleteCallback callback)
CompleteCallback after resolving (i.e. responding to/addressing) an
InboxEntity object.inboxEntity - See InboxEntitycallback - the callback to receive the result of resolving an InboxEntity
objectpublic void get(boolean unresolved,
boolean forceRefresh,
SingleCallback<java.util.List<InboxEntity>> callback)
List of InboxEntity objects for all badges on a device.unresolved - true if the List of InboxEntity objects for
unresolved items is desired;
false if the List of InboxEntity objects
for resolved items is desiredforceRefresh - true if the List of InboxEntity objects should be
fetched directly from the server;
false if the List of InboxEntity objects
should be retrieved from the cachecallback - the callback to receive the List of InboxEntity objects
for all badges on a devicepublic void count(SingleCallback<java.lang.Integer> callback)
InboxEntity objects for all badges on a
device.callback - the callback to receive the number of unresolved InboxEntity objects
for all badges on a device