HyphenateChatSDK 3.9.9.1
构造函数 | 所有成员列表
<IEMThreadManager>协议 参考
类 <IEMThreadManager> 继承关系图:

构造函数

(void) - addDelegate:delegateQueue:
 
(void) - removeDelegate:
 
(void) - getChatThreadFromSever:completion:
 
(void) - getJoinedChatThreadsFromServerWithCursor:pageSize:completion:
 
(void) - getChatThreadsFromServerWithParentId:cursor:pageSize:completion:
 
(void) - getJoinedChatThreadsFromServerWithParentId:cursor:pageSize:completion:
 
(void) - getChatThreadMemberListFromServerWithId:cursor:pageSize:completion:
 
(void) - getLastMessageFromSeverWithChatThreads:completion:
 
(void) - removeMemberFromChatThread:threadId:completion:
 
(void) - updateChatThreadName:threadId:completion:
 
(void) - createChatThread:messageId:parentId:completion:
 
(void) - joinChatThread:completion:
 
(void) - leaveChatThread:completion:
 
(void) - destroyChatThread:completion:
 

函数文档

◆ addDelegate:delegateQueue:

- (void) addDelegate: (id< EMThreadManagerDelegate >)  aDelegate
delegateQueue: (_Nullable dispatch_queue_t)  aQueue 
required

添加回调代理

参数
aDelegate要添加的子区正常的增删改查的代理
aQueue代理执行的队列,如果是nil,则在主线程

◆ createChatThread:messageId:parentId:completion:

- (void) createChatThread: (NSString *)  threadName
messageId: (NSString *)  messageId
parentId: (NSString *)  parentId
completion: (void(^)(EMChatThread *_Nullable thread, EMError *_Nullable aError))  aCompletionBlock 
required

Create a subsection

参数
threadName要创建的子区的名称(限制64个字符)
messageId操作创建子区那一条消息id
parentId操作创建子区那一条消息所在的会话id也就是那条消息的to
completion返回回调,包含一个EMChatThread对象跟一个EMError的错误对象

◆ destroyChatThread:completion:

- (void) destroyChatThread: (NSString *)  athreadId
completion: (void(^)(EMError *_Nullable aError))  aCompletionBlock 
required

销毁一个子区(群管理员及其以上级别可调用)

参数
threadId要销毁的子区的id
aCompletionBlock返回回调,成功或者失败

◆ getChatThreadFromSever:completion:

- (void) getChatThreadFromSever: (NSString *)  threadId
completion: (void(^)(EMChatThread *_Nullable thread, EMError *_Nullable aError))  aCompletionBlock 
required

获取thread详情

参数
threadId要获取的子区的id
aCompletionBlock返回回调,包含一个EMChatThread对象跟一个EMError的错误对象

◆ getChatThreadMemberListFromServerWithId:cursor:pageSize:completion:

- (void) getChatThreadMemberListFromServerWithId: (NSString *)  threadId
cursor: (NSString *)  aCursor
pageSize: (NSInteger)  pageSize
completion: (void(^)(EMCursorResult< NSString * > *_Nullable aResult, EMError *_Nullable aError))  aCompletionBlock 
required

从服务器获取一个子区的成员列表

参数
threadId要获取成员的子区的id
aCursorcursor 上一次取数的位置游标
pageSize单次请求数量
aCompletionBlock返回回调,包含一个EMCursorResult对象跟一个EMError的错误对象

◆ getChatThreadsFromServerWithParentId:cursor:pageSize:completion:

- (void) getChatThreadsFromServerWithParentId: (NSString *)  parentId
cursor: (nullable NSString *)  aCursor
pageSize: (NSInteger)  aPageSize
completion: (void(^)(EMCursorResult< EMChatThread * > *_Nullable result, EMError *_Nullable aError))  aCompletionBlock 
required

从服务器获取一个群组下的子区

参数
parentId子区的上一级所属会话id
aCursorcursor 上一次取数的位置游标
pageSize单次请求数量(最大不超过50)
aCompletionBlock返回回调,包含一个EMCursorResult对象跟一个EMError的错误对象

◆ getJoinedChatThreadsFromServerWithCursor:pageSize:completion:

- (void) getJoinedChatThreadsFromServerWithCursor: (NSString *)  aCursor
pageSize: (NSInteger)  aPageSize
completion: (void(^)(EMCursorResult< EMChatThread * > *_Nullable result, EMError *_Nullable aError))  aCompletionBlock 
required

从服务器获取用户已加入的子区

参数
aCursorcursor 上一次取数的位置游标
pageSize单次请求数量(单次请求限制最大50)
aCompletionBlock返回回调,包含一个EMCursorResult对象跟一个EMError的错误对象

◆ getJoinedChatThreadsFromServerWithParentId:cursor:pageSize:completion:

- (void) getJoinedChatThreadsFromServerWithParentId: (NSString *)  parentId
cursor: (NSString *)  aCursor
pageSize: (NSInteger)  aPageSize
completion: (void(^)(EMCursorResult< EMChatThread * > *_Nullable result, EMError *_Nullable aError))  aCompletionBlock 
required

从服务器获取一个群组下我加入的子区

参数
parentId子区的上一级所属会话id
aCursorcursor 上一次取数的位置游标
pageSize单次请求数量(最大不超过50)
aCompletionBlock返回回调,包含一个EMCursorResult对象跟一个EMError的错误对象

◆ getLastMessageFromSeverWithChatThreads:completion:

- (void) getLastMessageFromSeverWithChatThreads: (NSArray< NSString * > *)  threadIds
completion: (void(^)(NSDictionary< NSString *, EMChatMessage * > *_Nullable messageMap, EMError *_Nullable aError))  aCompletionBlock 
required

从服务器批量获取子区的最后一条消息

参数
threadIds要获取的子区的id数组(单次请求不超过20个id)
aCompletionBlock返回回调,包含一个字典key是子区id,value是EMChatMessage对象

◆ joinChatThread:completion:

- (void) joinChatThread: (NSString *)  threadId
completion: (void(^)(EMChatThread *_Nullable thread, EMError *_Nullable aError))  aCompletionBlock 
required

加入一个子区

参数
threadId要加入的子区的id
aCompletionBlock返回回调,成功或者失败

◆ leaveChatThread:completion:

- (void) leaveChatThread: (NSString *)  athreadId
completion: (void(^)(EMError *_Nullable aError))  aCompletionBlock 
required

离开一个子区

参数
threadId要离开的子区的id
aCompletionBlock返回回调,成功或者失败

◆ removeDelegate:

- (void) removeDelegate: (id< EMThreadManagerDelegate >)  aDelegate
required

移除回调代理

参数
aDelegate要移除的代理

◆ removeMemberFromChatThread:threadId:completion:

- (void) removeMemberFromChatThread: (NSString *)  aUser
threadId: (NSString *)  athreadId
completion: (void(^)(EMError *_Nullable aError))  aCompletionBlock 
required

移除子区成员(仅群管理可用)

参数
aUser要移除用户的环信id
threadId要操作的子区id
aCompletionBlock返回回调,成功或者失败

◆ updateChatThreadName:threadId:completion:

- (void) updateChatThreadName: (NSString *)  name
threadId: (NSString *)  athreadId
completion: (void(^)(EMError *_Nullable aError))  aCompletionBlock 
required

更新子区名称(仅群管理或创建者可用)

参数
subject你想要修改的名称(限制64个字符)
threadId要操作的子区id
aCompletionBlock返回回调,成功或者失败

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