Chat SDK for Android v1.3.1
agora java chat SDK
|
Public Member Functions | |
void | publishPresence (String customStatus, CallBack callBack) |
void | subscribePresences (List< String > members, long expiry, ValueCallBack< List< Presence > > callBack) |
void | unsubscribePresences (List< String > members, CallBack callBack) |
void | fetchSubscribedMembers (int pageNum, int pageSize, ValueCallBack< List< String > > callBack) |
void | fetchPresenceStatus (List< String > members, ValueCallBack< List< Presence > > callBack) |
void | addListener (PresenceListener listener) |
void | removeListener (PresenceListener listener) |
void | clearListeners () |
The Manager that defines how to manage presence states.
void io.agora.chat.PresenceManager.addListener | ( | PresenceListener | listener | ) |
Adds a listener.
listener | PresenceListener The listener to be added. |
void io.agora.chat.PresenceManager.clearListeners | ( | ) |
Removes all listeners.
void io.agora.chat.PresenceManager.fetchPresenceStatus | ( | List< String > | members, |
ValueCallBack< List< Presence > > | callBack | ||
) |
Gets the current presence state of users.
members | The array of IDs of users whose current presence state you want to check. |
callBack | The completion block, which contains the users whose presence state you have subscribed to. |
void io.agora.chat.PresenceManager.fetchSubscribedMembers | ( | int | pageNum, |
int | pageSize, | ||
ValueCallBack< List< String > > | callBack | ||
) |
Uses pagination to get a list of users whose presence states you have subscribed to.
pageNum | The current page number, starting from 0. |
pageSize | The number of subscribed users on each page. |
callBack | The completion block, which contains IDs of users whose presence states you have subscribed to. Returns nil if you subscribe to no user's presence state. |
void io.agora.chat.PresenceManager.publishPresence | ( | String | customStatus, |
CallBack | callBack | ||
) |
Publishes a custom presence state.
customStatus | The custom presence status.The custom presence status can be obtained by Presence#getExt(). |
callBack | The completion block, which contains the error message if this method fails. |
void io.agora.chat.PresenceManager.removeListener | ( | PresenceListener | listener | ) |
Removes a listener.
listener | PresenceListener The listener to be removed. |
void io.agora.chat.PresenceManager.subscribePresences | ( | List< String > | members, |
long | expiry, | ||
ValueCallBack< List< Presence > > | callBack | ||
) |
Subscribes to a user's presence states. If the subscription succeeds, the subscriber will receive the callback when the user's presence state changes.
members | The array of IDs of users whose presence states you want to subscribe to. |
expiry | The expiration time of the presence subscription. |
callBack | The completion block, which contains the error message if the method fails. |
void io.agora.chat.PresenceManager.unsubscribePresences | ( | List< String > | members, |
CallBack | callBack | ||
) |
Unsubscribes from a user's presence states.
members | The array of IDs of users whose presence states you want to unsubscribe from. |
callBack | The completion block, which contains the error message if the method fails. |