NIMSDK-iOS
载入中...
搜索中...
未找到
<NIMChatManagerDelegate>协议 参考

#import <NIMChatManagerProtocol.h>

类 <NIMChatManagerDelegate> 继承关系图:

构造函数

(void) - willSendMessage:
 
(void) - uploadAttachmentSuccess:forMessage:
 
(void) - sendMessage:progress:
 
(void) - sendMessage:didCompleteWithError:
 
(void) - onRecvMessages:
 
(void) - onRecvMessageReceipts:
 
(void) - onRecvRevokeMessageNotification:
 
(void) - fetchMessageAttachment:progress:
 
(void) - fetchMessageAttachment:didCompleteWithError:
 

详细描述

聊天委托

函数文档

◆ fetchMessageAttachment:didCompleteWithError:

- (void) fetchMessageAttachment: (NIMMessage *)  message
didCompleteWithError: (nullable NSError *)  error 
optional

收取消息附件完成回调

参数
message当前收取的消息
error错误返回,如果收取成功,error为nil

◆ fetchMessageAttachment:progress:

- (void) fetchMessageAttachment: (NIMMessage *)  message
progress: (float)  progress 
optional

收取消息附件回调

参数
message当前收取的消息
progress进度 @discussion 附件包括:图片,视频的缩略图,语音文件

◆ onRecvMessageReceipts:

- (void) onRecvMessageReceipts: (NSArray< NIMMessageReceipt * > *)  receipts
optional

收到消息回执

参数
receipts消息回执数组 @discussion 当上层收到此消息时所有的存储和 model 层业务都已经更新,只需要更新 UI 即可。

◆ onRecvMessages:

- (void) onRecvMessages: (NSArray< NIMMessage * > *)  messages
optional

收到消息回调

参数
messages消息列表,内部为NIMMessage

◆ onRecvRevokeMessageNotification:

- (void) onRecvRevokeMessageNotification: (NIMRevokeMessageNotification *)  notification
optional

收到消息被撤回的通知

参数
notification被撤回的消息信息 @discusssion 云信在收到消息撤回后,会先从本地数据库中找到对应消息并进行删除,之后通知上层消息已删除

◆ sendMessage:didCompleteWithError:

- (void) sendMessage: (NIMMessage *)  message
didCompleteWithError: (nullable NSError *)  error 
optional

发送消息完成回调

参数
message当前发送的消息
error失败原因,如果发送成功则error为nil

◆ sendMessage:progress:

- (void) sendMessage: (NIMMessage *)  message
progress: (float)  progress 
optional

发送消息进度回调

参数
message当前发送的消息
progress进度

◆ uploadAttachmentSuccess:forMessage:

- (void) uploadAttachmentSuccess: (NSString *)  urlString
forMessage: (NIMMessage *)  message 
optional

上传资源文件成功的回调 @discussion 对于需要上传资源的消息(图片,视频,音频等),SDK 将在上传资源成功后通过这个接口进行回调,上层可以在收到该回调后进行推送信息的重新配置 (APNS payload)

参数
urlString当前消息资源获得的 url 地址
message当前发送的消息

◆ willSendMessage:

- (void) willSendMessage: (NIMMessage *)  message
optional

即将发送消息回调 @discussion 因为发消息之前可能会有个准备过程,所以需要在收到这个回调时才将消息加入到 Datasource 中

参数
message当前发送的消息

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