fetchGroupAcks method Null safety
Gets read receipts for group messages from the server with pagination.
See also: For how to send read receipts for group messages, see {@link {@link #sendConversationReadAck(String)}.
Param msgId
The message ID.
Param startAckId
The starting read receipt ID for query. If you set it as null, the SDK retrieves the read receipts in the in reverse chronological order.
Param pageSize
The number of read receipts per page.
Return The list of obtained read receipts and the cursor for next query.
Throws A description of the exception. See {@link EMError}.
Implementation
Future<EMCursorResult<EMGroupMessageAck?>> fetchGroupAcks(
String msgId, {
String? startAckId,
int pageSize = 0,
}) async {
Map req = Map();
req["msg_id"] = msgId;
if (startAckId != null) {
req["ack_id"] = startAckId;
}
req["pageSize"] = pageSize;
Map result =
await _channel.invokeMethod(ChatMethodKeys.asyncFetchGroupAcks, req);
try {
EMError.hasErrorFromResult(result);
EMCursorResult<EMGroupMessageAck?> cursorResult = EMCursorResult.fromJson(
result[ChatMethodKeys.asyncFetchGroupAcks],
dataItemCallback: (map) {
return EMGroupMessageAck.fromJson(map);
},
);
return cursorResult;
} on EMError catch (e) {
throw e;
}
}