sendConversationReadAck method

Future<bool> sendConversationReadAck(
  1. String conversationId
)

Sends the conversation read receipt to the server. This method is only for one-to-one chat conversations.

This method informs the server to set the unread message count of the conversation to 0. In multi-device scenarios, all the devices receive the ChatEventHandler.onConversationRead callback.

Note This method applies to one-to-one chat conversations only. To send a group message read receipt, call sendGroupMessageReadAck.

Param conversationId The conversation ID.

Throws A description of the exception. See ChatError.

Implementation

Future<bool> sendConversationReadAck(String conversationId) async {
  Map req = {"convId": conversationId};
  Map result =
      await ChatChannel.invokeMethod(ChatMethodKeys.ackConversationRead, req);
  try {
    ChatError.hasErrorFromResult(result);
    return result.boolValue(ChatMethodKeys.ackConversationRead);
  } on ChatError catch (e) {
    throw e;
  }
}