ChatEventHandler class
~english The chat event handler.
This handler is used to check whether messages are received. If messages are sent successfully, a delivery receipt will be returned (delivery receipt needs to be enabled: ChatOptions.requireDeliveryAck. If the peer user reads the received message, a read receipt will be returned (read receipt needs to be enabled: ChatOptions.requireAck). This API should be implemented in the app to listen for message status changes.
Adds chat event handler:
ChatClient.getInstance.chatManager.addEventHandler(UNIQUE_HANDLER_ID, ChatEventHandler());
Removes a chat event handler:
ChatClient.getInstance.chatManager.removeEventHandler(UNIQUE_HANDLER_ID);
~end
~chinese Chat 事件监听。
用于监听收消息,已读回执,等回调。
添加监听:
ChatClient.getInstance.chatManager.addEventHandler(UNIQUE_HANDLER_ID, ChatEventHandler());
移除监听:
ChatClient.getInstance.chatManager.removeEventHandler(UNIQUE_HANDLER_ID);
~end
Constructors
-
ChatEventHandler({void onMessagesReceived(List<
ChatMessage> messages)?, void onCmdMessagesReceived(List<ChatMessage> messages)?, void onMessagesRead(List<ChatMessage> messages)?, void onGroupMessageRead(List<ChatGroupMessageAck> groupMessageAcks)?, VoidCallback? onReadAckForGroupMessageUpdated, void onMessagesDelivered(List<ChatMessage> messages)?, void onMessagesRecalled(List<ChatMessage> messages)?, VoidCallback? onConversationsUpdate, void onConversationRead(String from, String to)?, void onMessageReactionDidChange(List<ChatMessageReactionEvent> events)?, void onMessageContentChanged(ChatMessage message, String operatorId, int operationTime)?, void onMessagePinChanged(String messageId, String conversationId, MessagePinOperation pinOperation, MessagePinInfo pinInfo)?}) - ~english The chat event handler.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
onCmdMessagesReceived
→ (void Function(List<
ChatMessage> messages)?) -
~english
Occurs when a command message is received.
final
- onConversationRead → (void Function(String from, String to)?)
-
~english
Occurs when a conversation read receipt is received.
final
- onConversationsUpdate → VoidCallback?
-
~english
Occurs when the conversation updated.
~end
final
-
onGroupMessageRead
→ (void Function(List<
ChatGroupMessageAck> groupMessageAcks)?) -
~english
Occurs when a read receipt is received for a group message.
~end
final
- onMessageContentChanged → (void Function(ChatMessage message, String operatorId, int operationTime)?)
-
~english
Occurs when the message content is modified.
~end
final
- onMessagePinChanged → (void Function(String messageId, String conversationId, MessagePinOperation pinOperation, MessagePinInfo pinInfo)?)
-
~english
Occurs when the message pin status changes.
final
-
onMessageReactionDidChange
→ (void Function(List<
ChatMessageReactionEvent> events)?) -
~english
Occurs when the Reaction data changes.
~end
final
-
onMessagesDelivered
→ (void Function(List<
ChatMessage> messages)?) -
~english
Occurs when a delivery receipt is received.
~end
final
-
onMessagesRead
→ (void Function(List<
ChatMessage> messages)?) -
~english
Occurs when a read receipt is received for a message.
~end
final
-
onMessagesRecalled
→ (void Function(List<
ChatMessage> messages)?) -
~english
Occurs when a received message is recalled.
~end
final
-
onMessagesReceived
→ (void Function(List<
ChatMessage> messages)?) -
~english
Occurs when a message is received.
final
- onReadAckForGroupMessageUpdated → VoidCallback?
-
~english
Occurs when the update for the group message read status is received.
~end
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
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