fetchHistoryMessagesByOption method
- String conversationId,
- EMConversationType type, {
- FetchMessageOptions? options,
- String? cursor,
- int pageSize = 50,
~english
Gets historical messages of a conversation from the server according to FetchMessageOptions
.
Param conversationId
The conversation ID, which is the user ID of the peer user for one-to-one chat, but the group ID for group chat.
Param type
The conversation type. See EMConversationType.
Param options
The parameter configuration class for pulling historical messages from the server. See FetchMessageOptions
.
Param cursor
The cursor position from which to start querying data.
Param pageSize
The number of messages that you expect to get on each page. The value range is 1,50
.
~end
~chinese
根据 FetchMessageOptions
从服务器分页获取指定会话的历史消息。
Param conversationId
会话 ID。
Param type
会话类型,详见 EMConversationType
Param options
查询历史消息的参数配置接口,详见 FetchMessageOptions
。
Param cursor
查询的起始游标位置。
Param pageSize
每页期望获取的消息条数。取值范围为 1,50
。
~end
Implementation
Future<EMCursorResult<EMMessage>> fetchHistoryMessagesByOption(
String conversationId,
EMConversationType type, {
FetchMessageOptions? options,
String? cursor,
int pageSize = 50,
}) async {
return Client.instance.chatManager.fetchHistoryMessagesByOption(
conversationId, type,
options: options, cursor: cursor, pageSize: pageSize);
}