You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Search [count] messages starting from this message. The retrieved list index==length-1 is the latest message, so to get the next page of history startMsg=list.first
count
int
Yes
Amount
lastMinSeq
int
Yes
Do not pass for the first page. Required when fetching from the second page onwards, works together with [startMsg]
Search [count] messages starting from this message. The retrieved list index==length-1 is the latest message, so to get the next page of history startMsg=list.first
Starting message clientMsgID, empty string for first pull, subsequently the clientMsgID of the last message from the previous pull
count
number
Yes
Amount to pull at once
viewType
ViewType
Yes
Determine whether it is a normal pull of chat history or getting message context after a search. The open-source version only supports pulling chat history (viewType is 0)
import{getSDK,ViewType}from'@openim/wasm-client-sdk';constIMSDK=getSDK();// use in electron with ffi// import { getWithRenderProcess } from '@openim/electron-client-sdk/lib/render';// const { instance: IMSDK } = getWithRenderProcess();// use in mini program// import { getSDK } from '@openim/client-sdk';// const IMSDK = getSDK();IMSDK.getAdvancedHistoryMessageList({viewType: ViewType.History,count: 20,startClientMsgID: '',conversationID: 'conversationID',}).then(({ data })=>{// Call successful}).catch(({ errCode, errMsg })=>{// Call failed});
Operation ID, used to pinpoint issues, keep unique, prefer time+random
conversationID
string
Yes
Conversation ID
startClientMsgID
string
Yes
Starting message clientMsgID, empty string for first pull, subsequently the clientMsgID of the last message from the previous pull
count
number
Yes
Amount to pull at once
lastMinSeq
number
Yes
lastMinSeq is the value returned from the last pull callback, context used, needs to be passed back on the second pull
Return Result
Use the openim-uniapp-polyfill package to make the function Promise. When calling, you need to use then and catch to determine and handle success and failure callbacks.