Browse SDKs · React Native
SDKsReact NativeEnterprise

Load message history in reverse

OpenIM React Native SDK guide for load message history in reverse.

Copy

Use getAdvancedHistoryMessageListReverse() to load history in the newer direction from a message anchor.

const page = await OpenIMSDK.getAdvancedHistoryMessageListReverse({
  conversationID,
  startClientMsgID: anchorMessage.clientMsgID,
  count: 30,
  viewType: ViewType.History,
});

Parameters

ParameterTypeRequiredDescription
conversationIDstringYesConversation whose history is loaded.
startClientMsgIDstringYesMessage ID used as the newer-direction anchor.
countnumberYesNumber of messages to load.
viewTypeViewTypeYesUse ViewType.History when browsing message history.

The call returns AdvancedGetMessageResult; messageList contains the current page and isEnd indicates whether the newer boundary has been reached. See Load message history for the other result fields.