Agora RTC Objective-C API Reference
Refactor
|
Inherits <NSObject>.
Instance Methods | |
(void) | - whoNow:channelType:options:completion: |
(void) | - getOnlineUsers:channelType:options:completion: |
(void) | - whereNow:completion: |
(void) | - getUserChannels:completion: |
(void) | - setState:channelType:items:completion: |
(void) | - removeState:channelType:keys:completion: |
(void) | - getState:channelType:userId:completion: |
The IRtmPresence class.
This class provides the rtm presence methods that can be invoked by your app.
- (instancetype _Nullable) NS_UNAVAILABLE |
- (void) whoNow: | (NSString *_Nonnull) | channelName | |
channelType: | (AgoraRtmChannelType) | channelType | |
options: | (AgoraRtmPresenceOptions *_Nullable) | options | |
completion: | (AgoraRtmWhoNowBlock _Nullable) | completionBlock | |
To query who joined this channel
channelName | The name of the channel. |
channelType | The type of the channel. |
options | The query option. |
completionBlock | The operation result will be notified by completionBlock, if operation success,will given a not nil response and nil errorInfo,if operation failed,will given a nil response and not nil errorInfo. |
- (void) getOnlineUsers: | (NSString *_Nonnull) | channelName | |
channelType: | (AgoraRtmChannelType) | channelType | |
options: | (AgoraRtmGetOnlineUsersOptions *_Nullable) | options | |
completion: | (AgoraRtmGetOnlineUsersBlock _Nullable) | completionBlock | |
To query who joined this channel
channelName | The name of the channel. |
channelType | The type of the channel. |
options | The query option. |
completionBlock | The operation result will be notified by completionBlock, if operation success,will given a not nil response and nil errorInfo,if operation failed,will given a nil response and not nil errorInfo. |
- (void) whereNow: | (NSString *_Nonnull) | userId | |
completion: | (AgoraRtmWhereNowBlock _Nullable) | completionBlock | |
To query which channels the user joined
userId | The id of the user. |
completionBlock | The operation result will be notified by completionBlock, if operation success,will given a not nil response and nil errorInfo,if operation failed,will given a nil response and not nil errorInfo. |
- (void) getUserChannels: | (NSString *_Nonnull) | userId | |
completion: | (AgoraRtmGetUserChannelsBlock _Nullable) | completionBlock | |
To query which channels the user joined
userId | The id of the user. |
completionBlock | The operation result will be notified by completionBlock, if operation success,will given a not nil response and nil errorInfo,if operation failed,will given a nil response and not nil errorInfo. |
- (void) setState: | (NSString *_Nonnull) | channelName | |
channelType: | (AgoraRtmChannelType) | channelType | |
items: | (NSDictionary< NSString *, NSString * > *_Nonnull) | items | |
completion: | (AgoraRtmOperationBlock _Nullable) | completionBlock | |
Set user state
channelName | The name of the channel. |
channelType | The type of the channel. |
items | The states item of user. |
completionBlock | The operation result will be notified by completionBlock, if operation success,will given a not nil response and nil errorInfo,if operation failed,will given a nil response and not nil errorInfo. |
- (void) removeState: | (NSString *_Nonnull) | channelName | |
channelType: | (AgoraRtmChannelType) | channelType | |
keys: | (NSArray< NSString * > *_Nonnull) | keys | |
completion: | (AgoraRtmOperationBlock _Nullable) | completionBlock | |
Delete user state
channelName | The name of the channel. |
channelType | The type of the channel. |
keys | The keys of state item. |
completionBlock | The operation result will be notified by completionBlock, if operation success,will given a not nil response and nil errorInfo,if operation failed,will given a nil response and not nil errorInfo. |
- (void) getState: | (NSString *_Nonnull) | channelName | |
channelType: | (AgoraRtmChannelType) | channelType | |
userId: | (NSString *_Nonnull) | userId | |
completion: | (AgoraRtmPresenceGetStateBlock _Nullable) | completionBlock | |
Get user state
channelName | The name of the channel. |
channelType | The type of the channel. |
userId | The id of the user. |
completionBlock | The operation result will be notified by completionBlock, if operation success,will given a not nil response and nil errorInfo,if operation failed,will given a nil response and not nil errorInfo. |