HyphenateSDK  3.6.1
构造函数 | 所有成员列表
<IEMChatroomManager>协议 参考

#import <IEMChatroomManager.h>

类 <IEMChatroomManager> 继承关系图:

构造函数

(void) - addDelegate:delegateQueue:
 
(void) - removeDelegate:
 
(EMPageResult *) - getChatroomsFromServerWithPage:pageSize:error:
 
(void) - getChatroomsFromServerWithPage:pageSize:completion:
 
(EMChatroom *) - createChatroomWithSubject:description:invitees:message:maxMembersCount:error:
 
(void) - createChatroomWithSubject:description:invitees:message:maxMembersCount:completion:
 
(EMChatroom *) - joinChatroom:error:
 
(void) - joinChatroom:completion:
 
(void) - leaveChatroom:error:
 
(void) - leaveChatroom:completion:
 
(EMError *) - destroyChatroom:
 
(void) - destroyChatroom:completion:
 
(EMChatroom *) - getChatroomSpecificationFromServerWithId:error:
 
(void) - getChatroomSpecificationFromServerWithId:completion:
 
(EMCursorResult *) - getChatroomMemberListFromServerWithId:cursor:pageSize:error:
 
(void) - getChatroomMemberListFromServerWithId:cursor:pageSize:completion:
 
(NSArray *) - getChatroomBlacklistFromServerWithId:pageNumber:pageSize:error:
 
(void) - getChatroomBlacklistFromServerWithId:pageNumber:pageSize:completion:
 
(NSArray *) - getChatroomMuteListFromServerWithId:pageNumber:pageSize:error:
 
(void) - getChatroomMuteListFromServerWithId:pageNumber:pageSize:completion:
 
(NSString *) - getChatroomAnnouncementWithId:error:
 
(void) - getChatroomAnnouncementWithId:completion:
 
(EMChatroom *) - updateSubject:forChatroom:error:
 
(void) - updateSubject:forChatroom:completion:
 
(EMChatroom *) - updateDescription:forChatroom:error:
 
(void) - updateDescription:forChatroom:completion:
 
(EMChatroom *) - removeMembers:fromChatroom:error:
 
(void) - removeMembers:fromChatroom:completion:
 
(EMChatroom *) - blockMembers:fromChatroom:error:
 
(void) - blockMembers:fromChatroom:completion:
 
(EMChatroom *) - unblockMembers:fromChatroom:error:
 
(void) - unblockMembers:fromChatroom:completion:
 
(EMChatroom *) - updateChatroomOwner:newOwner:error:
 
(void) - updateChatroomOwner:newOwner:completion:
 
(EMChatroom *) - addAdmin:toChatroom:error:
 
(void) - addAdmin:toChatroom:completion:
 
(EMChatroom *) - removeAdmin:fromChatroom:error:
 
(void) - removeAdmin:fromChatroom:completion:
 
(EMChatroom *) - muteMembers:muteMilliseconds:fromChatroom:error:
 
(void) - muteMembers:muteMilliseconds:fromChatroom:completion:
 
(EMChatroom *) - unmuteMembers:fromChatroom:error:
 
(void) - unmuteMembers:fromChatroom:completion:
 
(EMChatroom *) - updateChatroomAnnouncementWithId:announcement:error:
 
(void) - updateChatroomAnnouncementWithId:announcement:completion:
 
(EMChatroom *) - fetchChatroomInfo:includeMembersList:error:
 
(void) - getChatroomSpecificationFromServerByID:includeMembersList:completion:
 
(void) - addDelegate:
 
(NSArray *) - getAllChatroomsFromServerWithError:
 
(void) - getAllChatroomsFromServerWithCompletion:
 
(void) - asyncGetAllChatroomsFromServer:failure:
 
(void) - asyncJoinChatroom:success:failure:
 
(void) - asyncLeaveChatroom:success:failure:
 
(void) - asyncFetchChatroomInfo:includeMembersList:success:failure:
 

详细描述

聊天室相关操作

函数文档

- (void) addAdmin: (NSString *)  aAdmin
toChatroom: (NSString *)  aChatroomId
completion: (void(^)(EMChatroom *aChatroomp, EMError *aError))  aCompletionBlock 
required

添加聊天室管理员,需要Owner权限

参数
aAdmin要添加的群组管理员
aChatroomId聊天室ID
aCompletionBlock完成的回调
- (EMChatroom *) addAdmin: (NSString *)  aAdmin
toChatroom: (NSString *)  aChatroomId
error: (EMError **)  pError 
required

添加聊天室管理员,需要Owner权限

同步方法,会阻塞当前线程

参数
aAdmin要添加的管理员
aChatroomId聊天室ID
pError错误信息
返回
聊天室实例
- (void) addDelegate: (3_1_0) 
(3_2_2) 
("Use -")  EM_DEPRECATED_IOS[IEMChatroomManager addDelegate:delegateQueue:] 
required

添加回调代理

参数
aDelegate要添加的代理
- (void) addDelegate: (id< EMChatroomManagerDelegate >)  aDelegate
delegateQueue: (dispatch_queue_t)  aQueue 
required

添加回调代理

参数
aDelegate要添加的代理
aQueue添加回调代理
- (void) asyncFetchChatroomInfo: (NSString *)  aChatroomId
includeMembersList: (BOOL)  aIncludeMembersList
success: (void(^)(EMChatroom *aChatroom))  aSuccessBlock
failure: ("Use -getChatroomSpecificationFromServerByID:includeMembersList:completion:")  __deprecated_msg 
required

获取聊天室详情

参数
aChatroomId聊天室ID
aIncludeMembersList是否获取成员列表
aSuccessBlock成功的回调
aFailureBlock失败的回调
- (void) asyncGetAllChatroomsFromServer: (void(^)(NSArray *aList))  aSuccessBlock
failure: ("Use -getAllChatroomsFromServerWithCompletion:")  __deprecated_msg 
required

从服务器获取所有的聊天室

参数
aSuccessBlock成功的回调
aFailureBlock失败的回调
- (void) asyncJoinChatroom: (NSString *)  aChatroomId
success: (void(^)(EMChatroom *aRoom))  aSuccessBlock
failure: ("Use -joinChatroom:completion:")  __deprecated_msg 
required

加入聊天室

参数
aChatroomId聊天室的ID
aSuccessBlock成功的回调
aFailureBlock失败的回调
- (void) asyncLeaveChatroom: (NSString *)  aChatroomId
success: (void(^)(EMChatroom *aRoom))  aSuccessBlock
failure: ("Use -leaveChatroom:completion:")  __deprecated_msg 
required

退出聊天室

参数
aChatroomId聊天室ID
aSuccessBlock成功的回调
aFailureBlock失败的回调
返回
退出的聊天室
- (void) blockMembers: (NSArray *)  aMembers
fromChatroom: (NSString *)  aChatroomId
completion: (void(^)(EMChatroom *aChatroom, EMError *aError))  aCompletionBlock 
required

加人到聊天室黑名单, 需要owner权限

参数
aMembers要加入黑名单的用户
aChatroomId聊天室ID
aCompletionBlock完成的回调
- (EMChatroom *) blockMembers: (NSArray *)  aMembers
fromChatroom: (NSString *)  aChatroomId
error: (EMError **)  pError 
required

加人到聊天室黑名单, 需要owner权限

同步方法,会阻塞当前线程

参数
aMembers要加入黑名单的用户
aChatroomId聊天室ID
pError错误信息
返回
聊天室实例
- (void) createChatroomWithSubject: (NSString *)  aSubject
description: (NSString *)  aDescription
invitees: (NSArray *)  aInvitees
message: (NSString *)  aMessage
maxMembersCount: (NSInteger)  aMaxMembersCount
completion: (void(^)(EMChatroom *aChatroom, EMError *aError))  aCompletionBlock 
required

创建群组

参数
aSubject群组名称
aDescription群组描述
aInvitees群组成员(不包括创建者自己)
aMessage邀请消息
aMaxMembersCount群组最大成员数
aCompletionBlock完成的回调
- (EMChatroom *) createChatroomWithSubject: (NSString *)  aSubject
description: (NSString *)  aDescription
invitees: (NSArray *)  aInvitees
message: (NSString *)  aMessage
maxMembersCount: (NSInteger)  aMaxMembersCount
error: (EMError **)  pError 
required

创建聊天室

同步方法,会阻塞当前线程

参数
aSubject名称
aDescription描述
aInvitees成员(不包括创建者自己)
aMessage邀请消息
aMaxMembersCount群组最大成员数
pError出错信息
返回
创建的聊天室
- (EMError *) destroyChatroom: (NSString *)  aChatroomId
required

解散聊天室, 需要owner权限

同步方法,会阻塞当前线程

参数
aChatroomId聊天室ID
返回
错误信息, 成功返回nil
- (void) destroyChatroom: (NSString *)  aChatroomId
completion: (void(^)(EMError *aError))  aCompletionBlock 
required

解散群组, 需要owner权限

参数
aChatroomId聊天室ID
aCompletionBlock完成的回调
- (EMChatroom *) fetchChatroomInfo: (NSString *)  aChatroomId
includeMembersList: (BOOL)  aIncludeMembersList
error: (3_1_0) 
(3_3_0) 
("Use -")  EM_DEPRECATED_IOS[IEMChatroomManager getChatroomSpecificationFromServerWithId:error:] 
required

获取聊天室详情

同步方法,会阻塞当前线程

参数
aChatroomId聊天室ID
aIncludeMembersList是否获取成员列表,为YES时,返回200个成员
pError错误信息
返回
聊天室
- (void) getAllChatroomsFromServerWithCompletion: ("Use -getChatroomsFromServerWithPage")  __deprecated_msg
required

从服务器获取所有的聊天室

参数
aCompletionBlock完成的回调
- (NSArray *) getAllChatroomsFromServerWithError: ("Use -getChatroomsFromServerWithPage")  __deprecated_msg
required

从服务器获取所有的聊天室

同步方法,会阻塞当前线程

参数
pError出错信息
返回
聊天室列表<EMChatroom>
- (void) getChatroomAnnouncementWithId: (NSString *)  aChatroomId
completion: (void(^)(NSString *aAnnouncement, EMError *aError))  aCompletionBlock 
required

获取聊天室公告

参数
aChatroomId聊天室ID
aCompletionBlock完成的回调
- (NSString *) getChatroomAnnouncementWithId: (NSString *)  aChatroomId
error: (EMError **)  pError 
required

获取聊天室公告

参数
aChatroomId聊天室ID
pError错误信息
返回
聊天室公告
- (void) getChatroomBlacklistFromServerWithId: (NSString *)  aChatroomId
pageNumber: (NSInteger)  aPageNum
pageSize: (NSInteger)  aPageSize
completion: (void(^)(NSArray *aList, EMError *aError))  aCompletionBlock 
required

获取聊天室黑名单列表, 需要owner/admin权限

参数
aChatroomId聊天室ID
aPageNum获取第几页
aPageSize获取多少条
aCompletionBlock完成的回调
- (NSArray *) getChatroomBlacklistFromServerWithId: (NSString *)  aChatroomId
pageNumber: (NSInteger)  aPageNum
pageSize: (NSInteger)  aPageSize
error: (EMError **)  pError 
required

获取聊天室黑名单列表, 需要owner/admin权限

参数
aChatroomId聊天室ID
aPageNum获取第几页
aPageSize获取多少条
pError错误信息
- (void) getChatroomMemberListFromServerWithId: (NSString *)  aChatroomId
cursor: (NSString *)  aCursor
pageSize: (NSInteger)  aPageSize
completion: (void(^)(EMCursorResult *aResult, EMError *aError))  aCompletionBlock 
required

获取聊天室成员列表

参数
aChatroomId聊天室ID
aCursor游标,首次调用传空
aPageSize获取多少条
aCompletionBlock完成的回调
- (EMCursorResult *) getChatroomMemberListFromServerWithId: (NSString *)  aChatroomId
cursor: (NSString *)  aCursor
pageSize: (NSInteger)  aPageSize
error: (EMError **)  pError 
required

获取聊天室成员列表

参数
aChatroomId聊天室ID
aCursor游标,首次调用传空
aPageSize获取多少条
pError错误信息
返回
列表和游标
- (void) getChatroomMuteListFromServerWithId: (NSString *)  aChatroomId
pageNumber: (NSInteger)  aPageNum
pageSize: (NSInteger)  aPageSize
completion: (void(^)(NSArray *aList, EMError *aError))  aCompletionBlock 
required

获取聊天室被禁言列表

参数
aChatroomId聊天室ID
aPageNum获取第几页
aPageSize获取多少条
aCompletionBlock完成的回调
- (NSArray *) getChatroomMuteListFromServerWithId: (NSString *)  aChatroomId
pageNumber: (NSInteger)  aPageNum
pageSize: (NSInteger)  aPageSize
error: (EMError **)  pError 
required

获取聊天室被禁言列表

参数
aChatroomId聊天室ID
aPageNum获取第几页
aPageSize获取多少条
pError错误信息
- (void) getChatroomsFromServerWithPage: (NSInteger)  aPageNum
pageSize: (NSInteger)  aPageSize
completion: (void(^)(EMPageResult *aResult, EMError *aError))  aCompletionBlock 
required

从服务器获取指定数目的聊天室

参数
aPageNum获取第几页
aPageSize获取多少条
aCompletionBlock完成的回调
- (EMPageResult *) getChatroomsFromServerWithPage: (NSInteger)  aPageNum
pageSize: (NSInteger)  aPageSize
error: (EMError **)  pError 
required

从服务器获取指定数目的聊天室

同步方法,会阻塞当前线程

参数
aPageNum获取第几页
aPageSize获取多少条
pError出错信息
返回
聊天室列表<EMChatroom>
- (void) getChatroomSpecificationFromServerByID: (NSString *)  aChatroomId
includeMembersList: (BOOL)  aIncludeMembersList
completion: (3_1_0) 
(3_3_0) 
("Use -")  EM_DEPRECATED_IOS[IEMChatroomManager getChatroomSpecificationFromServerWithId:completion:] 
required

获取聊天室详情

参数
aChatroomId聊天室ID
aIncludeMembersList是否获取成员列表,为YES时,返回200个成员
aCompletionBlock完成的回调
- (void) getChatroomSpecificationFromServerWithId: (NSString *)  aChatroomId
completion: (void(^)(EMChatroom *aChatroom, EMError *aError))  aCompletionBlock 
required

获取聊天室详情

参数
aChatroomId聊天室ID
aCompletionBlock完成的回调
- (EMChatroom *) getChatroomSpecificationFromServerWithId: (NSString *)  aChatroomId
error: (EMError **)  pError 
required

获取聊天室详情

同步方法,会阻塞当前线程

参数
aChatroomId聊天室ID
pError错误信息
返回
聊天室
- (void) joinChatroom: (NSString *)  aChatroomId
completion: (void(^)(EMChatroom *aChatroom, EMError *aError))  aCompletionBlock 
required

加入聊天室

参数
aChatroomId聊天室的ID
aCompletionBlock完成的回调
- (EMChatroom *) joinChatroom: (NSString *)  aChatroomId
error: (EMError **)  pError 
required

加入聊天室

同步方法,会阻塞当前线程

参数
aChatroomId聊天室的ID
pError返回的错误信息
返回
所加入的聊天室
- (void) leaveChatroom: (NSString *)  aChatroomId
completion: (void(^)(EMError *aError))  aCompletionBlock 
required

退出聊天室

参数
aChatroomId聊天室ID
aCompletionBlock完成的回调
- (void) leaveChatroom: (NSString *)  aChatroomId
error: (EMError **)  pError 
required

退出聊天室

同步方法,会阻塞当前线程

参数
aChatroomId聊天室ID
pError错误信息
- (void) muteMembers: (NSArray *)  aMuteMembers
muteMilliseconds: (NSInteger)  aMuteMilliseconds
fromChatroom: (NSString *)  aChatroomId
completion: (void(^)(EMChatroom *aChatroom, EMError *aError))  aCompletionBlock 
required

将一组成员禁言,需要Owner / Admin权限

参数
aMuteMembers要禁言的成员列表<NSString>
aMuteMilliseconds禁言时长
aChatroomId聊天室ID
aCompletionBlock完成的回调
- (EMChatroom *) muteMembers: (NSArray *)  aMuteMembers
muteMilliseconds: (NSInteger)  aMuteMilliseconds
fromChatroom: (NSString *)  aChatroomId
error: (EMError **)  pError 
required

将一组成员禁言,需要Owner / Admin权限

同步方法,会阻塞当前线程

参数
aMuteMembers要禁言的成员列表<NSString>
aMuteMilliseconds禁言时长
aChatroomId聊天室ID
pError错误信息
返回
聊天室实例
- (void) removeAdmin: (NSString *)  aAdmin
fromChatroom: (NSString *)  aChatroomId
completion: (void(^)(EMChatroom *aChatroom, EMError *aError))  aCompletionBlock 
required

移除聊天室管理员,需要Owner权限

参数
aAdmin要添加的群组管理员
aChatroomId聊天室ID
aCompletionBlock完成的回调
- (EMChatroom *) removeAdmin: (NSString *)  aAdmin
fromChatroom: (NSString *)  aChatroomId
error: (EMError **)  pError 
required

移除聊天室管理员,需要Owner权限

同步方法,会阻塞当前线程

参数
aAdmin要移除的群组管理员
aChatroomId聊天室ID
pError错误信息
返回
聊天室实例
- (void) removeDelegate: (id< EMChatroomManagerDelegate >)  aDelegate
required

移除回调代理

参数
aDelegate要移除的代理
- (void) removeMembers: (NSArray *)  aMembers
fromChatroom: (NSString *)  aChatroomId
completion: (void(^)(EMChatroom *aChatroom, EMError *aError))  aCompletionBlock 
required

将成员移出聊天室, 需要owner/admin权限

参数
aMembers要移出的用户列表
aChatroomId聊天室ID
aCompletionBlock完成的回调
- (EMChatroom *) removeMembers: (NSArray *)  aMembers
fromChatroom: (NSString *)  aChatroomId
error: (EMError **)  pError 
required

将成员移出聊天室, 需要owner/admin权限

同步方法,会阻塞当前线程

参数
aMembers要移出的用户列表
aChatroomId聊天室ID
pError错误信息
返回
聊天室实例
- (void) unblockMembers: (NSArray *)  aMembers
fromChatroom: (NSString *)  aChatroomId
completion: (void(^)(EMChatroom *aChatroom, EMError *aError))  aCompletionBlock 
required

从聊天室黑名单中减人, 需要owner权限

参数
aMembers要从黑名单中移除的用户名列表
aChatroomId聊天室ID
aCompletionBlock完成的回调
- (EMChatroom *) unblockMembers: (NSArray *)  aMembers
fromChatroom: (NSString *)  aChatroomId
error: (EMError **)  pError 
required

从聊天室黑名单中减人, 需要owner权限

同步方法,会阻塞当前线程

参数
aMembers要从黑名单中移除的用户名列表
aChatroomId聊天室ID
pError错误信息
返回
聊天室对象
- (void) unmuteMembers: (NSArray *)  aMembers
fromChatroom: (NSString *)  aChatroomId
completion: (void(^)(EMChatroom *aChatroom, EMError *aError))  aCompletionBlock 
required

解除禁言,需要Owner / Admin权限

参数
aMuteMembers被解除的列表<NSString>
aChatroomId聊天室ID
aCompletionBlock完成的回调
- (EMChatroom *) unmuteMembers: (NSArray *)  aMembers
fromChatroom: (NSString *)  aChatroomId
error: (EMError **)  pError 
required

解除禁言,需要Owner / Admin权限

同步方法,会阻塞当前线程

参数
aMuteMembers被解除的列表<NSString>
aChatroomId聊天室ID
pError错误信息
返回
聊天室实例
- (void) updateChatroomAnnouncementWithId: (NSString *)  aChatroomId
announcement: (NSString *)  aAnnouncement
completion: (void(^)(EMChatroom *aChatroom, EMError *aError))  aCompletionBlock 
required

修改聊天室公告,需要Owner / Admin权限

参数
aChatroomId聊天室ID
aAnnouncement群公告
aCompletionBlock完成的回调
- (EMChatroom *) updateChatroomAnnouncementWithId: (NSString *)  aChatroomId
announcement: (NSString *)  aAnnouncement
error: (EMError **)  pError 
required

修改聊天室公告,需要Owner / Admin权限

参数
aChatroomId聊天室ID
aAnnouncement群公告
pError错误信息
返回
聊天室实例
- (void) updateChatroomOwner: (NSString *)  aChatroomId
newOwner: (NSString *)  aNewOwner
completion: (void(^)(EMChatroom *aChatroom, EMError *aError))  aCompletionBlock 
required

改变聊天室创建者,需要Owner权限

参数
aChatroomId聊天室ID
aNewOwner新Owner
aCompletionBlock完成的回调
- (EMChatroom *) updateChatroomOwner: (NSString *)  aChatroomId
newOwner: (NSString *)  aNewOwner
error: (EMError **)  pError 
required

改变聊天室创建者,需要Owner权限

同步方法,会阻塞当前线程

参数
aChatroomId聊天室ID
aNewOwner新Owner
pError错误信息
返回
聊天室实例
- (void) updateDescription: (NSString *)  aDescription
forChatroom: (NSString *)  aChatroomId
completion: (void(^)(EMChatroom *aChatroom, EMError *aError))  aCompletionBlock 
required

更改聊天室说明信息, 需要owner权限

参数
aDescription说明信息
aChatroomId聊天室ID
aCompletionBlock完成的回调
- (EMChatroom *) updateDescription: (NSString *)  aDescription
forChatroom: (NSString *)  aChatroomId
error: (EMError **)  pError 
required

更改聊天室说明信息, 需要owner权限

同步方法,会阻塞当前线程

参数
aDescription说明信息
aChatroomId聊天室ID
pError错误信息
返回
聊天室对象
- (void) updateSubject: (NSString *)  aSubject
forChatroom: (NSString *)  aChatroomId
completion: (void(^)(EMChatroom *aChatroom, EMError *aError))  aCompletionBlock 
required

更改聊天室主题, 需要owner权限

参数
aSubject新主题
aChatroomId聊天室ID
aCompletionBlock完成的回调
- (EMChatroom *) updateSubject: (NSString *)  aSubject
forChatroom: (NSString *)  aChatroomId
error: (EMError **)  pError 
required

更改聊天室主题, 需要owner权限

同步方法,会阻塞当前线程

参数
aSubject新主题
aChatroomId聊天室ID
pError错误信息
返回
聊天室对象

该协议的文档由以下文件生成: