sendGroupMessageReadAck method Null safety
Sends the group message receipt to the server.
You can call the method only after setting the following method: {@link ChatOptions#requireAck(bool)} and {@link ChatMessage#needGroupAck(bool)}.
Note
- This method takes effect only after you set {@link ChatOptions#requireAck} and {@link 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, 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 ChatError}.
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 ChatMethodChannel.ChatManager.invokeMethod(
ChatMethodKeys.ackGroupMessageRead, req);
try {
ChatError.hasErrorFromResult(result);
return result.boolValue(ChatMethodKeys.ackMessageRead);
} on ChatError catch (e) {
throw e;
}
}