Chat SDK for Unity and Windows v1.2.0
Public Member Functions | List of all members
AgoraChat.PresenceManager Class Reference
Inheritance diagram for AgoraChat.PresenceManager:

Public Member Functions

void PublishPresence (string description, CallBack callback=null)
 
void SubscribePresences (List< string > members, long expiry, ValueCallBack< List< Presence > > callback=null)
 
void UnsubscribePresences (List< string > members, CallBack callback=null)
 
void FetchSubscribedMembers (int pageNum, int pageSize, ValueCallBack< List< string > > callback=null)
 
void FetchPresenceStatus (List< string > members, ValueCallBack< List< Presence > > callback=null)
 
void AddPresenceManagerDelegate (IPresenceManagerDelegate presenceManagerDelegate)
 
void RemovePresenceManagerDelegate (IPresenceManagerDelegate presenceManagerDelegate)
 

Detailed Description

The presence manager class that defines methods of managing the presence state.

Member Function Documentation

◆ PublishPresence()

void AgoraChat.PresenceManager.PublishPresence ( string  description,
CallBack  callback = null 
)

Publishes a custom presence state.

Parameters
extThe description information of the presence state. It can be an empty string.
callBackThe result callback which contains the error message if this method fails.

◆ SubscribePresences()

void AgoraChat.PresenceManager.SubscribePresences ( List< string >  members,
long  expiry,
ValueCallBack< List< Presence > >  callback = null 
)

Subscribes to a user's presence state. If the subscription succeeds, the subscriber will receive the onPresenceUpdated callback when the user's presence state changes.

Parameters
membersThe array of user IDs whose presence states you want to subscribe to.
expiryThe subscription duration in seconds. The duration cannot exceed 2,592,000 (30×24×3600) seconds, i.e., 30 days.
callBackThe result callback which contains the error message if the method fails. Returns the current presence state of subscribed users if this method executes successfully.

◆ UnsubscribePresences()

void AgoraChat.PresenceManager.UnsubscribePresences ( List< string >  members,
CallBack  callback = null 
)

Unsubscribes from the presence state of the unspecified users.

Parameters
membersThe array of user IDs whose presence state you want to unsubscribe from.
callBackThe result callback, which contains the error message if the method fails.

◆ FetchSubscribedMembers()

void AgoraChat.PresenceManager.FetchSubscribedMembers ( int  pageNum,
int  pageSize,
ValueCallBack< List< string > >  callback = null 
)

Uses pagination to get the list of users whose presence state you have subscribed to.

Parameters
pageNumThe current page number, starting from 1.
pageSizeThe number of subscribed users displayed on each page.
callBackThe result callback, which contains user IDs whose presence state you have subscribed to. Returns an empty list if you do not subscribe to any user's presence state.

◆ FetchPresenceStatus()

void AgoraChat.PresenceManager.FetchPresenceStatus ( List< string >  members,
ValueCallBack< List< Presence > >  callback = null 
)

Gets the current presence state of the specified users.

Parameters
membersThe array of user IDs whose current presence state you want to get.
callBackThe result callback, which contains the current presence state of users you have subscribed to.

◆ AddPresenceManagerDelegate()

void AgoraChat.PresenceManager.AddPresenceManagerDelegate ( IPresenceManagerDelegate  presenceManagerDelegate)

Adds a presence state listener.

Parameters
listenerIPresenceManagerDelegate The presence state listener to add.

◆ RemovePresenceManagerDelegate()

void AgoraChat.PresenceManager.RemovePresenceManagerDelegate ( IPresenceManagerDelegate  presenceManagerDelegate)

Removes a presence listener.

Parameters
listenerIPresenceManagerDelegate The presence state listener to remove.