sendGroupMessageReadAck method
Sends the group message receipt to the server.
You can call the method only after setting the following method: ChatOptions.requireAck and ChatMessage.needGroupAck.
Note
- This method takes effect only after you set ChatOptions.requireAck and ChatMessage.needGroupAck as
true
. - This method applies to group messages only. To send a one-to-one chat message receipt, call sendMessageReadAck; to send a conversation receipt, call sendConversationReadAck.
Param msgId
The message ID.
Param groupId
The group ID.
Param content
The extension information, which is a custom keyword that specifies a custom action or command.
Throws A description of the exception. See ChatError.
Implementation
Future<void> sendGroupMessageReadAck(
String msgId,
String groupId, {
String? content,
}) async {
Map req = {
"msg_id": msgId,
"group_id": groupId,
};
req.putIfNotNull("content", content);
Map result =
await ChatChannel.invokeMethod(ChatMethodKeys.ackGroupMessageRead, req);
try {
ChatError.hasErrorFromResult(result);
} on ChatError catch (e) {
throw e;
}
}