get Remote History Messages
Fetches historical messages from the server before a specified time.
Unlike getHistoryMessages, this interface pulls messages from the RongCloud server. After pulling messages from the server, the client performs deduplication and returns the deduplicated data. This is typically used to fetch historical messages after switching to a new device. When using this, it is recommended to first pull historical messages from the local database via getHistoryMessages. If no historical messages are found in the local database, then use this interface to fetch server historical messages, passing the timestamp of the earliest message in the local database.Note: 1. This feature requires enabling the historical message cloud storage function in the RCdeveloper console. 2. If the messages to be fetched already exist in the local database, this interface will not return any data.
Since
5.0.0
Parameters
The type of conversation.
The target conversation ID. Depending on the conversationType, this could be a user ID, discussion group ID, or group ID.
The starting point for fetching messages. This is the sentTime getSentTime in the message; if there are no messages in the local database, you can pass 0 for the first fetch, otherwise pass the sentTime of the earliest message to fetch the latest count messages.
The number of messages to fetch, 0 < count <= 20
.
The callback for fetching historical messages, ordered from newest to oldest.
Fetches remote history messages for a specified conversation.
This feature requires the message cloud storage function to be enabled in the RongCloud Developer Console.Note: Chatrooms are not supported!
Since
5.0.0
Parameters
Specifies the conversation type. Chatrooms are not supported.
The conversation ID. Depending on the conversationType, it could be a user ID, discussion group ID, or group ID.
Configurable parameters RemoteHistoryMsgOption
Callback for retrieving history messages, ordered from newest to oldest.