EMChatManager class

Implemented types

Constructors

EMChatManager()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addListener(EMChatManagerListener listener) → void
添加消息监听 listener
deleteConversation(String conversationId, [bool deleteMessages = true]) Future<bool?>
删除会话, 如果deleteMessages设置为true,则同时删除消息。
downloadAttachment(EMMessage message) Future<EMMessage>
下载附件 message.
downloadThumbnail(EMMessage message) Future<EMMessage>
下载缩略图 message.
fetchHistoryMessages(String conversationId, {EMConversationType type = EMConversationType.Chat, int pageSize = 20, String startMsgId = ''}) Future<EMCursorResult<EMMessage?>>
在会话conversationId中提取历史消息,按type筛选。 结果按每页pageSize分页,从startMsgId开始。
getConversation(String conversationId, [EMConversationType type = EMConversationType.Chat, bool createIfNeed = true]) Future<EMConversation?>
通过会话id, 会话类型type获取会话.
getConversationsFromServer() Future<List<EMConversation>>
从服务器获取会话
getUnreadMessageCount() Future<int?>
获取未读消息的计数.
importMessages(List<EMMessage> messages) Future<bool?>
导入消息 messages.
loadAllConversations() Future<List<EMConversation>>
获取所有会话
loadMessage(String messageId) Future<EMMessage>
通过messageId从db获取消息.
markAllConversationsAsRead() Future<bool?>
将所有对话标记为已读.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onDeliveryAck() → void
消息已送达
override
onError(EMError error) → void
消息发送失败
override
onProgress(int progress) → void
消息进度
override
onReadAck() → void
消息已读
override
onStatusChanged() → void
消息状态发生改变
override
onSuccess() → void
消息发送成功
override
recallMessage(String messageId) Future<bool?>
撤回发送的消息(增值服务), 默认时效为2分钟,超过2分钟无法撤回.
removeListener(EMChatManagerListener listener) → void
移除消息监听listener
resendMessage(EMMessage message) Future<EMMessage>
重发消息 message.
searchMsgFromDB(String keywords, [EMMessageChatType type = EMMessageChatType.Chat, int timeStamp = 0, int maxCount = 20, String from = '', EMMessageSearchDirection direction = EMMessageSearchDirection.Up]) Future<List<EMMessage>>
搜索包含keywords的消息,消息类型为type,起始时间timeStamp,条数maxCount, 消息发送方from,方向direction
sendConversationReadAck(String conversationId) Future<bool?>
sendMessage(EMMessage message) Future<EMMessage>
发送消息 message.
sendMessageReadAck(EMMessage message) Future<bool?>
发送消息已读 message.
toString() String
A string representation of this object.
inherited
updateMessage(EMMessage message) Future<EMMessage>
更新消息message.

Operators

operator ==(Object other) bool
The equality operator.
inherited