Chat SDK for Android v1.3.1
agora java chat SDK
Public Member Functions | List of all members
io.agora.chat.PresenceManager Class Reference

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 ()
 

Detailed Description

The Manager that defines how to manage presence states.

Member Function Documentation

◆ addListener()

void io.agora.chat.PresenceManager.addListener ( PresenceListener  listener)

Adds a listener.

Parameters
listenerPresenceListener The listener to be added.

◆ clearListeners()

void io.agora.chat.PresenceManager.clearListeners ( )

Removes all listeners.

◆ fetchPresenceStatus()

void io.agora.chat.PresenceManager.fetchPresenceStatus ( List< String >  members,
ValueCallBack< List< Presence > >  callBack 
)

Gets the current presence state of users.

Parameters
membersThe array of IDs of users whose current presence state you want to check.
callBackThe completion block, which contains the users whose presence state you have subscribed to.

◆ fetchSubscribedMembers()

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.

Parameters
pageNumThe current page number, starting from 0.
pageSizeThe number of subscribed users on each page.
callBackThe 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.

◆ publishPresence()

void io.agora.chat.PresenceManager.publishPresence ( String  customStatus,
CallBack  callBack 
)

Publishes a custom presence state.

Parameters
customStatusThe custom presence status.The custom presence status can be obtained by Presence#getExt().
callBackThe completion block, which contains the error message if this method fails.

◆ removeListener()

void io.agora.chat.PresenceManager.removeListener ( PresenceListener  listener)

Removes a listener.

Parameters
listenerPresenceListener The listener to be removed.

◆ subscribePresences()

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.

Parameters
membersThe array of IDs of users whose presence states you want to subscribe to.
expiryThe expiration time of the presence subscription.
callBackThe completion block, which contains the error message if the method fails.

◆ unsubscribePresences()

void io.agora.chat.PresenceManager.unsubscribePresences ( List< String >  members,
CallBack  callBack 
)

Unsubscribes from a user's presence states.

Parameters
membersThe array of IDs of users whose presence states you want to unsubscribe from.
callBackThe completion block, which contains the error message if the method fails.

The documentation for this class was generated from the following file: