fetchMessageHistory method Null safety

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}
)

Get history messages. You can specify a period to query history messages and list the results in reverse-chronological order or chronological order. The obtained history messages contain chatroom notifications.

roomId The chatroom ID

startTime The timestamp (unit: millisecond)

limit Specify the maximum history messages that can be obtained (upper limit: 100).

direction Specify the order (reverse chronological or chronological) to list the obtained history messages.

messageTypeList Specify the type of history messages to be obtained.

Implementation

Future<NIMResult<List<NIMChatroomMessage>>> fetchMessageHistory({
  required String roomId,
  required int startTime,
  required int limit,
  required QueryDirection direction,
  List<NIMMessageType>? messageTypeList,
}) {
  return _platform.fetchMessageHistory(
    roomId: roomId,
    startTime: startTime,
    limit: limit,
    direction: direction,
    messageTypeList: messageTypeList,
  );
}