sendMessageReadAck method

Future<bool> sendMessageReadAck(
  1. ChatMessage message
)

Sends the read receipt to the server.

This method applies to one-to-one chats only.

Warning This method only takes effect if you set ChatOptions.requireAck as true.

Note To send the group message read receipt, call sendGroupMessageReadAck.

We recommend that you call sendConversationReadAck when entering a chat page, and call this method to reduce the number of method calls.

Param message The message body: ChatMessage.

Throws A description of the exception. See ChatError.

Implementation

Future<bool> sendMessageReadAck(ChatMessage message) async {
  Map req = {"to": message.from, "msg_id": message.msgId};
  Map result =
      await ChatChannel.invokeMethod(ChatMethodKeys.ackMessageRead, req);
  try {
    ChatError.hasErrorFromResult(result);
    return result.boolValue(ChatMethodKeys.ackMessageRead);
  } on ChatError catch (e) {
    throw e;
  }
}