EMChatEventHandler class

Chat 事件监听。

用于监听收消息,已读回执,等回调。

添加监听:

  EMClient.getInstance.chatManager.addEventHandler(UNIQUE_HANDLER_ID, EMChatEventHandler());

移除监听:

  EMClient.getInstance.chatManager.removeEventHandler(UNIQUE_HANDLER_ID);

Constructors

EMChatEventHandler({void onMessagesReceived(List<EMMessage> messages)?, void onCmdMessagesReceived(List<EMMessage> messages)?, void onMessagesRead(List<EMMessage> messages)?, void onGroupMessageRead(List<EMGroupMessageAck> groupMessageAcks)?, VoidCallback? onReadAckForGroupMessageUpdated, void onMessagesDelivered(List<EMMessage> messages)?, void onMessagesRecalled(List<EMMessage> messages)?, VoidCallback? onConversationsUpdate, void onConversationRead(String from, String to)?, void onMessageReactionDidChange(List<EMMessageReactionEvent> events)?, void onMessageContentChanged(EMMessage message, String operatorId, int operationTime)?, void onMessagePinChanged(String messageId, String conversationId, MessagePinOperation pinOperation, MessagePinInfo pinInfo)?, void onMessagesRecalledInfo(List<RecallMessageInfo>)?})
消息事件监听。

Properties

hashCode int
The hash code for this object.
read-onlyinherited
onCmdMessagesReceived → (void Function(List<EMMessage> messages)?)
收到命令消息回调。 与 onMessagesReceived 不同, 这个回调只包含命令的消息,命令消息通常不对用户展示。
final
onConversationRead → (void Function(String from, String to)?)
收到会话已读回执的回调。
final
onConversationsUpdate VoidCallback?
会话更新事件回调。
final
onGroupMessageRead → (void Function(List<EMGroupMessageAck> groupMessageAcks)?)
收到群组消息的已读回执的回调。
final
onMessageContentChanged → (void Function(EMMessage message, String operatorId, int operationTime)?)
收到消息内容变化。
final
onMessagePinChanged → (void Function(String messageId, String conversationId, MessagePinOperation pinOperation, MessagePinInfo pinInfo)?)
消息置顶状态变化。
final
onMessageReactionDidChange → (void Function(List<EMMessageReactionEvent> events)?)
消息表情回复(Reaction)变化监听器。
final
onMessagesDelivered → (void Function(List<EMMessage> messages)?)
收到消息已送达回执的回调。
final
onMessagesRead → (void Function(List<EMMessage> messages)?)
收到单聊消息已读回执的回调。
final
onMessagesRecalled → (void Function(List<EMMessage> messages)?)
已收到的消息被撤回的回调。
final
onMessagesRecalledInfo → (void Function(List<RecallMessageInfo>)?)
已收到的消息被撤回的回调。
final
onMessagesReceived → (void Function(List<EMMessage> messages)?)
收到消息回调。 在收到文本、图片、视频、语音、地理位置和文件等消息时,通过此回调通知用户。
final
onReadAckForGroupMessageUpdated VoidCallback?
群消息已读变更。
final
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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