sendGroupMessageReadAck method

Future<void> sendGroupMessageReadAck(
  1. String msgId,
  2. String groupId,
  3. {String? content}
)

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

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;
  }
}