sendMessageReadAck method Null safety
- 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 {@link ChatOptions#requireAck(bool)} as true.
Note To send the group message read receipt, call {@link #sendGroupMessageReadAck(String, String, String)}.
We recommend that you call {@link #sendConversationReadAck(String)} when entering a chat page, and call this method to reduce the number of method calls.
Param message The message body: {@link ChatMessage}.
Throws A description of the exception. See {@link ChatError}.
Implementation
Future<bool> sendMessageReadAck(ChatMessage message) async {
Map req = {"to": message.from, "msg_id": message.msgId};
Map result = await ChatMethodChannel.ChatManager.invokeMethod(
ChatMethodKeys.ackMessageRead, req);
try {
ChatError.hasErrorFromResult(result);
return result.boolValue(ChatMethodKeys.ackMessageRead);
} on ChatError catch (e) {
throw e;
}
}