SDKsWASMEnterprise
Load message history in reverse
Retrieve history from a message anchor toward newer messages.
Use the reverse history API when you already have a message anchor and need to fill in messages that come after it.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
conversationID | string | Yes | ID of the conversation whose messages to retrieve. |
startClientMsgID | string | Yes | Anchor message ID from which to read toward newer messages. |
count | number | Yes | Maximum number of messages to retrieve. |
viewType | ViewType | Yes | Message viewing direction. Use ViewType.History when loading history. |
import { ViewType } from '@openim/wasm-client-sdk';
const { data: page } =
await openimsdk.getAdvancedHistoryMessageListReverse({
conversationID,
startClientMsgID: anchorMessage.clientMsgID,
count: 30,
viewType: ViewType.History,
});When the Promise resolves, data is an AdvancedGetMessageResult. For field descriptions and result-status handling, see Load message history. On this page, isEnd indicates whether the query has reached the boundary in the newer-message direction.
Do not mix both loading directions at the same scroll boundary. Deduplicate merged results by conversationID:clientMsgID.
Was this page helpful?