hyphenate_SDK4.0 4.8.0
hyphenate java IM SDK
Public Member Functions | List of all members
com.hyphenate.chat.EMPresenceManager Class Reference

Public Member Functions

void publishPresence (String customStatus, EMCallBack callBack)
 
void subscribePresences (List< String > members, long expiry, EMValueCallBack< List< EMPresence > > callBack)
 
void unsubscribePresences (List< String > members, EMCallBack callBack)
 
void fetchSubscribedMembers (int pageNum, int pageSize, EMValueCallBack< List< String > > callBack)
 
void fetchPresenceStatus (List< String > members, EMValueCallBack< List< EMPresence > > callBack)
 
void addListener (EMPresenceListener listener)
 
void removeListener (EMPresenceListener listener)
 
void clearListeners ()
 

Detailed Description

The Manager that defines how to manage presence states.

Member Function Documentation

◆ addListener()

void com.hyphenate.chat.EMPresenceManager.addListener ( EMPresenceListener  listener)

Adds a listener.

Parameters
listenerEMPresenceListener The listener to be added.

◆ clearListeners()

void com.hyphenate.chat.EMPresenceManager.clearListeners ( )

Removes all listeners.

◆ fetchPresenceStatus()

void com.hyphenate.chat.EMPresenceManager.fetchPresenceStatus ( List< String >  members,
EMValueCallBack< List< EMPresence > >  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 com.hyphenate.chat.EMPresenceManager.fetchSubscribedMembers ( int  pageNum,
int  pageSize,
EMValueCallBack< 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 com.hyphenate.chat.EMPresenceManager.publishPresence ( String  customStatus,
EMCallBack  callBack 
)

Publishes a custom presence state.

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

◆ removeListener()

void com.hyphenate.chat.EMPresenceManager.removeListener ( EMPresenceListener  listener)

Removes a listener.

Parameters
listenerEMPresenceListener The listener to be removed.

◆ subscribePresences()

void com.hyphenate.chat.EMPresenceManager.subscribePresences ( List< String >  members,
long  expiry,
EMValueCallBack< List< EMPresence > >  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 com.hyphenate.chat.EMPresenceManager.unsubscribePresences ( List< String >  members,
EMCallBack  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: