fetchGroupAcks method
~english Gets read receipts for group messages from the server with pagination.
For how to send read receipts for group messages, see sendConversationReadAck.
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 ChatError. ~end
~chinese 从服务器获取群组消息回执详情。
分页获取。
Note 发送群组消息回执,详见 sendConversationReadAck。
Param msgId
消息 ID。
Param startAckId
已读回执的 ID,如果为空,从最新的回执向前开始获取。
Param pageSize
每页获取群消息已读回执的条数。
Return 返回回执列表和用于下次获取群消息回执的 ChatCursorResult
Throws 如果有异常会在这里抛出,包含错误码和错误描述,详见 ChatError。 ~end
Implementation
Future<ChatCursorResult<ChatGroupMessageAck>> fetchGroupAcks(
String msgId,
String groupId, {
String? startAckId,
int pageSize = 0,
}) async {
Map req = {"msg_id": msgId, "group_id": groupId};
req["pageSize"] = pageSize;
req.putIfNotNull("ack_id", startAckId);
Map result =
await ChatChannel.invokeMethod(ChatMethodKeys.asyncFetchGroupAcks, req);
try {
ChatError.hasErrorFromResult(result);
ChatCursorResult<ChatGroupMessageAck> cursorResult =
ChatCursorResult.fromJson(
result[ChatMethodKeys.asyncFetchGroupAcks],
dataItemCallback: (map) {
return ChatGroupMessageAck.fromJson(map);
},
);
return cursorResult;
} on ChatError catch (e) {
throw e;
}
}