Load newer message history
Use the Flutter SDK to page from a message anchor toward newer message history.
Page forward from a specific message anchor (such as after searching or jumping to a quoted message) toward newer message history:
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
conversationID | String | Yes | Target conversation ID. |
startMsg | Message? | No | Starting anchor message for reverse pagination. Loads messages created after this anchor. |
count | int | Yes | Number of messages to retrieve in this batch. |
viewType | int? | No | History view type, defaulting to normal history (GetHistoryViewType.history). |
Code example
final page = await OpenIM.iMManager.messageManager
.getAdvancedHistoryMessageListReverse(
conversationID: conversationID,
startMsg: anchorMessage,
count: 30,
viewType: GetHistoryViewType.history,
);Avoid mixing forward and reverse cursor directions on the same scrolling boundary to prevent timeline rendering discontinuities.
Return value
Returns a Future resolving to an advanced message pagination object (AdvancedMessage). Its messageList contains messages retrieved forward toward the newest timestamp.
State changes after the call
This query retrieves a point-in-time snapshot and does not trigger new-message event callbacks. When merging into your UI list, constrain updates to the target conversationID and deduplicate records strictly by non-empty clientMsgID. To load older historical messages while scrolling upward, see Load older messages.
Was this page helpful?