getHistoryMessageList method Null safety

Future<V2TimValueCallback<List<V2TimMessage>>> getHistoryMessageList(
  1. {HistoryMsgGetTypeEnum getType = HistoryMsgGetTypeEnum.V2TIM_GET_LOCAL_OLDER_MSG,
  2. String? userID,
  3. String? groupID,
  4. int lastMsgSeq = -1,
  5. required int count,
  6. String? lastMsgID}
)

Get historical messages (advanced API)

Parameter

getType pulls the message type, you can set to pull the local, cloud older or newer messages (the specific type is in the HistoryMessageGetType class)
lastMsg/lastMsgSeq is used to indicate the starting point of the pull, you can leave it blank or Fill in 0;

Note: If option is set to pull messages from the cloud, and the IM SDK detects that the network connection is unavailable, the IM SDK directly returns local data. Only meeting groups (Meeting) support pulling historical messages of members before they join the groups. For audio-video groups (AVChatRoom), messages are not saved to the roaming and local databases, and therefore this API does not take effect.

The web side uses this interface, the messages are pulled from the remote end, and lastMsgSeq is not supported

Implementation

Future<V2TimValueCallback<List<V2TimMessage>>> getHistoryMessageList({
  HistoryMsgGetTypeEnum getType =
      HistoryMsgGetTypeEnum.V2TIM_GET_LOCAL_OLDER_MSG,
  String? userID,
  String? groupID,
  int lastMsgSeq = -1,
  required int count,
  String? lastMsgID,
}) async {
  return ImFlutterPlatform.instance.getHistoryMessageList(
      getType: EnumUtils.convertHistoryMsgGetTypeEnum(getType),
      userID: userID,
      count: count,
      lastMsgID: lastMsgID,
      groupID: groupID,
      lastMsgSeq: lastMsgSeq);
}