AgoraChatSDK 1.3.1
|
#import <IAgoraChatPresenceManager.h>
Instance Methods | |
(void) | - publishPresenceWithDescription:completion: |
(void) | - subscribe:expiry:completion: |
(void) | - unsubscribe:completion: |
(void) | - fetchSubscribedMembersWithPageNum:pageSize:Completion: |
(void) | - fetchPresenceStatus:completion: |
(void) | - addDelegate:delegateQueue: |
(void) | - removeDelegate: |
@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.
The presence management protocol that defines how to manage presence states.
- (void) addDelegate: | (id< AgoraChatPresenceManagerDelegate > _Nonnull) | aDelegate | |
delegateQueue: | (dispatch_queue_t _Nullable) | aQueue | |
Adds a delegate.
aDelegate | The 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. |
- (void) fetchPresenceStatus: | (NSArray< NSString * > *_Nonnull) | members | |
completion: | (void(^)(NSArray< AgoraChatPresence * > *_Nullable presences, AgoraChatError *_Nullable error)) | aCompletion | |
Gets the current presence state of users.
members | The array of IDs of users whose current presence state you want to check. |
aCompletion | The completion block, which contains the users whose presence state you have subscribed to. |
- (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.
pageNum | The current page number, starting from 1. |
pageSize | The number of subscribed users on each page. |
aCompletion | 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) publishPresenceWithDescription: | (NSString *_Nullable) | aDescription | |
completion: | (void(^)(AgoraChatError *_Nullable error)) | aCompletion | |
Publishes a custom presence state.
aDescription | The extension information of the presence state. It can be set as nil. |
aCompletion | The completion block, which contains the error message if this method fails. |
- (void) removeDelegate: | (id< AgoraChatPresenceManagerDelegate > _Nonnull) | aDelegate |
Removes a delegate.
aDelegate | The delegate to be removed. |
- (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.
members | The array of IDs of users whose presence states you want to subscribe to. |
expiry | The expiration time of the presence subscription. |
aCompletion | The completion block, which contains the error message if the method fails. |
- (void) unsubscribe: | (NSArray< NSString * > *_Nonnull) | members | |
completion: | (void(^)(AgoraChatError *_Nullable error)) | aCompletion | |
Unsubscribes from a user's presence states.
members | The array of IDs of users whose presence states you want to unsubscribe from. |
aCompletion | The completion block, which contains the error message if the method fails. |