sendConversationReadAck method

Future<void> 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<void> sendConversationReadAck(String conversationId) async {
  Map req = {"convId": conversationId};
  Map result = await ChatChannel.invokeMethod(
    ChatMethodKeys.ackConversationRead,
    req,
  );
  try {
    ChatError.hasErrorFromResult(result);
  } on ChatError catch (e) {
    throw e;
  }
}