#import <IEMChatManager.h>
添加回调代理
- 参数
-
aDelegate | 要添加的代理 |
aQueue | 执行代理方法的队列 |
- (void) asyncDownloadMessageAttachments: |
|
(EMMessage *) |
aMessage |
progress: |
|
(void(^)(int progress)) |
aProgressCompletion |
completion: |
|
(void(^)(EMMessage *message, EMError *error)) |
aCompletion |
|
|
| |
|
required |
下载消息附件(语音,视频,图片原图,文件),SDK会自动下载语音消息,所以除非自动下载语音失败,用户不需要自动下载语音附件
异步方法
- 参数
-
aMessage | 消息 |
aProgressCompletion | 附件下载进度回调block |
aCompletion | 下载完成回调block |
- (void) asyncDownloadMessageThumbnail: |
|
(EMMessage *) |
aMessage |
progress: |
|
(void(^)(int progress)) |
aProgressCompletion |
completion: |
|
(void(^)(EMMessage *message, EMError *error)) |
aCompletion |
|
|
| |
|
required |
下载缩略图(图片消息的缩略图或视频消息的第一帧图片),SDK会自动下载缩略图,所以除非自动下载失败,用户不需要自己下载缩略图
异步方法
- 参数
-
aMessage | 消息 |
aProgressCompletion | 附件下载进度回调block |
aCompletion | 下载完成回调block |
- (void) asyncResendMessage: |
|
(EMMessage *) |
aMessage |
progress: |
|
(void(^)(int progress)) |
aProgressCompletion |
completion: |
|
(void(^)(EMMessage *message, EMError *error)) |
aCompletion |
|
|
| |
|
required |
重发送消息
异步方法
- 参数
-
aMessage | 消息 |
aProgressCompletion | 附件上传进度回调block |
aCompletion | 发送完成回调block |
- (void) asyncSendMessage: |
|
(EMMessage *) |
aMessage |
progress: |
|
(void(^)(int progress)) |
aProgressCompletion |
completion: |
|
(void(^)(EMMessage *message, EMError *error)) |
aCompletion |
|
|
| |
|
required |
发送消息
异步方法
- 参数
-
aMessage | 消息 |
aProgressCompletion | 附件上传进度回调block |
aCompletion | 发送完成回调block |
- (void) asyncSendReadAckForMessage: |
|
(EMMessage *) |
aMessage |
|
|
required |
- (BOOL) deleteConversation: |
|
(NSString *) |
aConversationId |
deleteMessages: |
|
(BOOL) |
aDeleteMessage |
|
|
| |
|
required |
删除会话
- 参数
-
aConversationId | 会话ID |
aDeleteMessage | 是否删除会话中的消息 |
- 返回
- 是否成功
- (BOOL) deleteConversations: |
|
(NSArray *) |
aConversations |
deleteMessages: |
|
(BOOL) |
aDeleteMessage |
|
|
| |
|
required |
删除一组会话
- 参数
-
aConversations | 会话列表<EMConversation> |
aDeleteMessage | 是否删除会话中的消息 |
- 返回
- 是否成功
- (NSArray *) getAllConversations |
|
|
|
|
required |
获取所有会话,如果内存中不存在会从DB中加载
- 返回
- 会话列表<EMConversation>
- (EMConversation *) getConversation: |
|
(NSString *) |
aConversationId |
type: |
|
(EMConversationType) |
aType |
createIfNotExist: |
|
(BOOL) |
aIfCreate |
|
|
| |
|
required |
获取一个会话
- 参数
-
aConversationId | 会话ID |
aType | 会话类型 |
aIfCreate | 如果不存在是否创建 |
- 返回
- 会话对象
- (NSString *) getMessageAttachmentPath: |
|
(NSString *) |
aConversationId |
|
|
required |
获取消息附件路径, 存在这个路径的文件,删除会话时会被删除
- 参数
-
- 返回
- 附件路径
- (BOOL) importConversations: |
|
(NSArray *) |
aConversations |
|
|
required |
导入一组会话到DB
- 参数
-
aConversations | 会话列表<EMConversation> |
- 返回
- 是否成功
- (BOOL) importMessages: |
|
(NSArray *) |
aMessages |
|
|
required |
- (NSArray *) loadAllConversationsFromDB |
|
|
|
|
required |
从数据库中获取所有的会话,执行后会更新内存中的会话列表
同步方法,会阻塞当前线程
- 返回
- 会话列表<EMConversation>
- (BOOL) updateMessage: |
|
(EMMessage *) |
aMessage |
|
|
required |
该协议的文档由以下文件生成: