NIMChatExtendManager Protocol Reference

Conforms to NSObject
Declared in NIMChatExtendManagerProtocol.h

Overview

聊天扩展

– reply:to:error: required method

回复消息

- (BOOL)reply:(NIMMessage *)message to:(NIMMessage *)target error:(NSError *__nullable *)error

Parameters

message

新生成的消息

target

被回复的消息

error

错误 如果在准备发送消息阶段发生错误,这个error会被填充相应的信息

Return Value

是否调用成功,这里返回的 result 只是表示当前这个函数调用是否成功,需要后续的回调才能够判断消息是否已经发送至服务器

Discussion

回复消息

Declared In

NIMChatExtendManagerProtocol.h

– reply:to:completion: required method

异步回复消息

- (void)reply:(NIMMessage *)message to:(NIMMessage *)target completion:(__nullable NIMChatManagerBlock)block

Parameters

message

新生成的消息

target

被回复的消息

block

发送完成后的回调,这里的回调完成只表示当前这个函数调用完成,需要后续的回调才能判断消息是否已经发送至服务器

Discussion

异步回复消息

Declared In

NIMChatExtendManagerProtocol.h

– subMessages: required method

本地获取Thread Talk的消息列表

- (NSArray<NIMMessage*> *_Nullable)subMessages:(NIMMessage *)message

Parameters

message

父消息

Return Value

目标message的子消息列表

Discussion

本地获取Thread Talk的消息列表

Declared In

NIMChatExtendManagerProtocol.h

– subMessagesCount: required method

本地获取Thread Talk的消息列表

- (NSInteger)subMessagesCount:(NIMMessage *)message

Parameters

message

父消息

Return Value

目标message的子消息数目

Discussion

本地获取Thread Talk的消息列表

Declared In

NIMChatExtendManagerProtocol.h

– fetchSubMessages:option:completion: required method

获取指定消息的Thread Talk子消息

- (void)fetchSubMessages:(NIMChatExtendBasicInfo *)info option:(NIMThreadTalkFetchOption *_Nullable)option completion:(NIMThreadTalkFetchMessages)block

Parameters

info

目标消息

option

查询分页选项

block

完成回调

Discussion

获取指定消息的Thread Talk子消息

Declared In

NIMChatExtendManagerProtocol.h

– fetchSubMessagesFrom:option:completion: required method

获取指定消息的Thread Talk子消息

- (void)fetchSubMessagesFrom:(NIMMessage *)message option:(NIMThreadTalkFetchOption *_Nullable)option completion:(NIMThreadTalkFetchMessages)block

Parameters

message

目标消息

option

查询分页选项

block

完成回调

Discussion

获取指定消息的Thread Talk子消息

Declared In

NIMChatExtendManagerProtocol.h

– fetchHistoryMessages:syncToDB:completion: required method

根据MessageId等获取消息

- (void)fetchHistoryMessages:(NSArray<NIMChatExtendBasicInfo*> *)infos syncToDB:(BOOL)sync completion:(NIMFetchHistoryMessagesByIds)block

Parameters

infos

请求信息

sync

是否同步到本地,注:DB标记状态删除的消息无法被同步覆盖

block

完成回调

Discussion

根据MessageId等获取消息

Declared In

NIMChatExtendManagerProtocol.h

– addQuickComment:toMessage:completion: required method

发送快捷回复

- (void)addQuickComment:(NIMQuickComment *)comment toMessage:(NIMMessage *)message completion:(NIMQuickCommentHandler _Nullable)completion

Parameters

comment

回复内容

message

被回复消息

completion

完成回调

Discussion

发送快捷回复

Declared In

NIMChatExtendManagerProtocol.h

– deleteQuickComment:completion: required method

从服务端删除一条评论

- (void)deleteQuickComment:(NIMQuickComment *)comment completion:(NIMQuickCommentHandler _Nullable)completion

Parameters

comment

目标评论

completion

完成回调

Discussion

从服务端删除一条评论

Declared In

NIMChatExtendManagerProtocol.h

– fetchQuickComments:completion: required method

批量获取快捷评论

- (void)fetchQuickComments:(NSArray<NIMMessage*> *)messages completion:(NIMFetchCommentsByMsgsHandler)completion

Parameters

messages

目标消息, 最多批量20个

completion

完成回调

Discussion

批量获取快捷评论

Declared In

NIMChatExtendManagerProtocol.h

– quickCommentsByMessage:completion: required method

本地获取消息对应的快捷评论结果

- (void)quickCommentsByMessage:(NIMMessage *)message completion:(NIMGetQuickCommentsByMsgHandler)completion

Parameters

message

目标消息

completion

完成回调

Discussion

本地获取消息对应的快捷评论结果

Declared In

NIMChatExtendManagerProtocol.h

– queryCollect:completion: required method

分页查询收藏列表

- (void)queryCollect:(NIMCollectQueryOptions *)option completion:(nullable NIMCollectQueryBlock)completion

Parameters

option

分页查询选项

completion

查询完成的回调

Discussion

分页查询收藏列表

Declared In

NIMChatExtendManagerProtocol.h

– addCollect:completion: required method

添加一个收藏

- (void)addCollect:(NIMAddCollectParams *)info completion:(nullable NIMAddCollectBlock)completion

Parameters

info

添加收藏的参数,必须字段:type、data、ext

completion

添加完成的回调

Discussion

添加一个收藏

Declared In

NIMChatExtendManagerProtocol.h

– removeCollect:completion: required method

批量移除收藏

- (void)removeCollect:(NSArray<NIMCollectInfo*> *)collectList completion:(nullable NIMRemoveCollectBlock)completion

Parameters

collectList

批量移除的收藏对象,必须字段:id、createTime

completion

移除完成的回调

Discussion

批量移除收藏

Declared In

NIMChatExtendManagerProtocol.h

– updateCollect:completion: required method

更新收藏ext

- (void)updateCollect:(NIMCollectInfo *)collectInfo completion:(nullable NIMUpdateCollectBlock)completion

Parameters

collectInfo

需要更新的收藏对象,需要id、createTime、ext字段,如果ext不传,表示删除ext字段

Discussion

更新收藏ext

Declared In

NIMChatExtendManagerProtocol.h

– addStickTopSession:completion: required method

添加一条置顶记录

- (void)addStickTopSession:(NIMAddStickTopSessionParams *)params completion:(nullable NIMAddStickTopSessionCompletion)completion

Parameters

params

添加置顶的参数

completion

添加置顶记录完成的回调

Discussion

添加一条置顶记录

Declared In

NIMChatExtendManagerProtocol.h

– removeStickTopSession:completion: required method

删除一条置顶记录

- (void)removeStickTopSession:(NIMStickTopSessionInfo *)info completion:(nullable NIMRemoveStickTopSessionCompletion)completion

Parameters

info

需要删除的置顶记录

completion

删除完成的回调

Discussion

删除一条置顶记录

Declared In

NIMChatExtendManagerProtocol.h

– udpateStickTopSession:completion: required method

更新一条置顶记录的扩展信息

- (void)udpateStickTopSession:(NIMStickTopSessionInfo *)info completion:(nullable NIMUpdateStickTopSessionCompletion)completion

Parameters

info

需要更新的置顶记录

completion

删除完成的回调

Discussion

更新一条置顶记录的扩展信息

Declared In

NIMChatExtendManagerProtocol.h

– loadStickTopSessionInfos: required method

查找所有的置顶记录

- (void)loadStickTopSessionInfos:(nullable NIMLoadStickTopSessionInfosCompletion)completion

Parameters

completion

查找完成的回调

Discussion

查找所有的置顶记录

Declared In

NIMChatExtendManagerProtocol.h

– loadRecentSessionsWithOptions:completion: required method

获取最近会话列表

- (void)loadRecentSessionsWithOptions:(NIMLoadRecentSessionsOptions *)options completion:(nullable NIMLoadRecentSessionsCompletion)completion

Parameters

options

查询选项(如按照置顶会话排序)

Discussion

获取最近会话列表

Declared In

NIMChatExtendManagerProtocol.h

– sortRecentSessions:withStickTopInfos: required method

根据置顶信息排序最近会话

- (NSArray<NIMRecentSession*> *)sortRecentSessions:(NSArray<NIMRecentSession*> *)recentSessions withStickTopInfos:(NSDictionary<NIMSession*,NIMStickTopSessionInfo*> *)infos

Parameters

recentSessions

需要排序的置顶会话,若传可变数组则进行in place排序

infos

[会话:置顶信息] 映射

Return Value

排序后的最近会话列表,若传如可变数组,则返回其数组本身

Discussion

根据置顶信息排序最近会话

Declared In

NIMChatExtendManagerProtocol.h

– stickTopInfoForSession: required method

查询某个会话的置顶信息

- (NIMStickTopSessionInfo *)stickTopInfoForSession:(NIMSession *)session

Parameters

session

需要查询的会话

Return Value

置顶信息

Discussion

查询某个会话的置顶信息

Declared In

NIMChatExtendManagerProtocol.h

– addMessagePin:completion: required method

添加一条PIN记录

- (void)addMessagePin:(NIMMessagePinItem *)item completion:(nullable NIMAddMessagePinCompletion)completion

Parameters

item

需要添加的PIN记录

completion

添加完成的回调

Discussion

添加一条PIN记录

Declared In

NIMChatExtendManagerProtocol.h

– removeMessagePin:completion: required method

删除一条PIN记录

- (void)removeMessagePin:(NIMMessagePinItem *)item completion:(nullable NIMRemoveMessagePinCompletion)completion

Parameters

item

需要删除的PIN记录

completion

删除完成的回调

Discussion

删除一条PIN记录

Declared In

NIMChatExtendManagerProtocol.h

– updateMessagePin:completion: required method

更新一条PIN记录的扩展字段(ext)

- (void)updateMessagePin:(NIMMessagePinItem *)item completion:(nullable NIMUpdateMessagePinCompletion)completion

Parameters

item

需要更新的PIN记录,ext不传为删除

completion

更新完成的回调

Discussion

更新一条PIN记录的扩展字段(ext)

Declared In

NIMChatExtendManagerProtocol.h

– loadMessagePinsForSession:completion: required method

查询全部PIN记录(登录后首次查询该会话会触发一次网络同步)

- (void)loadMessagePinsForSession:(NIMSession *)session completion:(nullable NIMLoadMessagePinsCompletion)completion

Parameters

session

会话

completion

加载完成的回调

Discussion

查询全部PIN记录(登录后首次查询该会话会触发一次网络同步)

Declared In

NIMChatExtendManagerProtocol.h

– pinItemForMessage: required method

查询某条消息的PIN记录

- (NIMMessagePinItem *)pinItemForMessage:(NIMMessage *)message

Parameters

message

消息

Return Value

记录

Discussion

查询某条消息的PIN记录

Declared In

NIMChatExtendManagerProtocol.h

– addDelegate: required method

  • 添加Thread Talk委托 *
  • @param delegate 聊天委托
- (void)addDelegate:(id<NIMChatExtendManagerDelegate>)delegate

Discussion

  • 添加Thread Talk委托 *
  • @param delegate 聊天委托

Declared In

NIMChatExtendManagerProtocol.h

– removeDelegate: required method

移除Thread Talk委托

- (void)removeDelegate:(id<NIMChatExtendManagerDelegate>)delegate

Parameters

delegate

聊天委托

Discussion

移除Thread Talk委托

Declared In

NIMChatExtendManagerProtocol.h