sendConversationReadAck method

Future<void> sendConversationReadAck(
  1. String conversationId
)

~english 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. ~end

~chinese 发送会话的已读回执,该方法只针对单聊会话。

该方法会通知服务器将此会话未读数设置为 0,对话方(包含多端多设备)将会在下面这个回调方法中接收到回调: ChatEventHandler.onConversationRead

Note 发送群组消息已读回执见 sendGroupMessageReadAck

Param conversationId 会话 ID。

Throws 如果有异常会在这里抛出,包含错误码和错误描述,详见 ChatError。 ~end

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