sendGroupMessageReadAck method Null safety
Sends the group message receipt to the server.
You can call the method only after setting the following method: {@link EMOptions#requireAck(bool)} and {@link EMMessage#needGroupAck(bool)}.
Note
- This method takes effect only after you set {@link EMOptions#requireAck} and {@link EMMessage#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, callsendConversationReadAck
.
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 {@link EMError}.
Implementation
Future<bool> sendGroupMessageReadAck(
String msgId,
String groupId, {
String? content,
}) async {
Map req = {
"msg_id": msgId,
"group_id": groupId,
};
req.setValueWithOutNull("content", content);
Map result = await EMMethodChannel.ChatManager.invokeMethod(
ChatMethodKeys.ackGroupMessageRead, req);
try {
EMError.hasErrorFromResult(result);
return result.boolValue(ChatMethodKeys.ackMessageRead);
} on EMError catch (e) {
throw e;
}
}