AgoraChatSDK 1.3.1
Instance Methods | List of all members
<IAgoraChatPresenceManager> Protocol Reference

#import <IAgoraChatPresenceManager.h>

Inheritance diagram for <IAgoraChatPresenceManager>:

Instance Methods

(void) - publishPresenceWithDescription:completion:
 
(void) - subscribe:expiry:completion:
 
(void) - unsubscribe:completion:
 
(void) - fetchSubscribedMembersWithPageNum:pageSize:Completion:
 
(void) - fetchPresenceStatus:completion:
 
(void) - addDelegate:delegateQueue:
 
(void) - removeDelegate:
 

Detailed Description

@header IAgoraChatPresenceManager.h @abstract The presence management class, responsible for publishing a custom presence state, managing presence subscriptions, querying the current presence state of a user, and adding and removing a delegate.

Author
Hyphenate
Version
3.00

The presence management protocol that defines how to manage presence states.

Method Documentation

◆ addDelegate:delegateQueue:

- (void) addDelegate: (id< AgoraChatPresenceManagerDelegate > _Nonnull)  aDelegate
delegateQueue: (dispatch_queue_t _Nullable)  aQueue 

Adds a delegate.

Parameters
aDelegateThe delegate to be added.
aQueue(optional) The queue of calling delegate methods. If you want to run the app on the main thread, set this parameter as nil.

◆ fetchPresenceStatus:completion:

- (void) fetchPresenceStatus: (NSArray< NSString * > *_Nonnull)  members
completion: (void(^)(NSArray< AgoraChatPresence * > *_Nullable presences, AgoraChatError *_Nullable error))  aCompletion 

Gets the current presence state of users.

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

◆ fetchSubscribedMembersWithPageNum:pageSize:Completion:

- (void) fetchSubscribedMembersWithPageNum: (NSUInteger)  pageNum
pageSize: (NSUInteger)  pageSize
Completion: (void(^)(NSArray< NSString * > *_Nullable members, AgoraChatError *_Nullable error))  aCompletion 

Uses pagination to get a list of users whose presence states you have subscribed to.

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

◆ publishPresenceWithDescription:completion:

- (void) publishPresenceWithDescription: (NSString *_Nullable)  aDescription
completion: (void(^)(AgoraChatError *_Nullable error))  aCompletion 

Publishes a custom presence state.

Parameters
aDescriptionThe extension information of the presence state. It can be set as nil.
aCompletionThe completion block, which contains the error message if this method fails.

◆ removeDelegate:

- (void) removeDelegate: (id< AgoraChatPresenceManagerDelegate > _Nonnull)  aDelegate

Removes a delegate.

Parameters
aDelegateThe delegate to be removed.

◆ subscribe:expiry:completion:

- (void) subscribe: (NSArray< NSString * > *_Nonnull)  members
expiry: (NSInteger)  expiry
completion: (void(^)(NSArray< AgoraChatPresence * > *_Nullable presences, AgoraChatError *_Nullable error))  aCompletion 

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.
aCompletionThe completion block, which contains the error message if the method fails.

◆ unsubscribe:completion:

- (void) unsubscribe: (NSArray< NSString * > *_Nonnull)  members
completion: (void(^)(AgoraChatError *_Nullable error))  aCompletion 

Unsubscribes from a user's presence states.

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

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