fetchMessageHistory method

Future<NIMResult<List<NIMChatroomMessage>>> fetchMessageHistory({
  1. required String roomId,
  2. required int startTime,
  3. required int limit,
  4. required QueryDirection direction,
  5. List<NIMMessageType>? messageTypeList,
})

获取历史消息,可选择给定时间往前或者往后查询,若方向往前,则结果排序按时间逆序,反之则结果排序按时间顺序。

roomId 聊天室id

startTime 时间戳,单位毫秒

limit 可拉取的消息数量

direction 查询方向

messageTypeList 查询的消息类型

Implementation

Future<NIMResult<List<NIMChatroomMessage>>> fetchMessageHistory({
  required String roomId,
  required int startTime,
  required int limit,
  required QueryDirection direction,
  List<NIMMessageType>? messageTypeList,
}) async {
  throw UnimplementedError('fetchMessageHistory is not implemented');
}