[**RongIMLib**](../../../../README.md) *** [RongIMLib](../../../../globals.md) / [electronExtension](../README.md) / getContinuousMessages # Function: getContinuousMessages() > **getContinuousMessages**(`conversation`, `options`): `Promise`\<[`RCResult`](../../../../interfaces/RCResult.md)\<\{ `list`: [`IAReceivedMessage`](../../../../interfaces/IAReceivedMessage.md)[]; `timestamp`: `number`; `hasMore`: `boolean`; \}\>\> 获取本地与远端历史消息 ## Parameters ### conversation [`IConversationIdentifier`](../../../../interfaces/IConversationIdentifier.md) 会话信息 ### options [`GetHistoryMessageOption`](../../../../interfaces/GetHistoryMessageOption.md) ## Returns `Promise`\<[`RCResult`](../../../../interfaces/RCResult.md)\<\{ `list`: [`IAReceivedMessage`](../../../../interfaces/IAReceivedMessage.md)[]; `timestamp`: `number`; `hasMore`: `boolean`; \}\>\> ## Description 本接口仅适用 Electron 平台且需要业务层开启 `单群聊云存储服务` 方法与 [getRemoteHistoryMessages](../../../../functions/getRemoteHistoryMessages.md) 的区别是 getContinuousMessages 会先查询指定会话存储本地数据库的消息, 当本地消息无法满足查询条件时,再查询在单群聊消息云端存储中的历史消息,以返回连续且相邻的消息对象列表 **注意**: 1. 分页获取时,下次传的时间戳必须使用 getContinuousMessages 接口返回的 timestamp 2. 获取历史消息逻辑:优先获取本地数据历史消息,本地获取不到再获取远端历史消息,但是该情况可能会因为离线或者补偿消息存储天数影响,出现消息断档现象 3. 该功能不适用于超级群会话。 消息断档现象:因为离线或者补偿消息存储天数影响,存储在本地数据库中消息存在不连续或者说中间某段时间消息丢失 比如离线消息和补偿消息都为 1 天,第一天 A 给 B 发送 1, 2, 3,第二天 A 给 B 发送 4, 5, 6, B 第二天再登入,由于离线消息和补偿消息都为 1 天,所以 B 只能收到 4, 5, 6。1, 2, 3 消息丢失 3. option 中的 Count 字段仅支持 1-100 范围 ## Since 5.9.6 ## Example 获取本地与远端历史消息示例: ```ts const conversation = { conversationType: RongIMLib.ConversationType.PRIVATE, targetId: 'targetId' }; const options = { timestamp: 0, count: 20, order: 0 }; const res = await RongIMLib.electronExtension.getContinuousMessages(conversation, option); console.info('获取本地与远端历史消息结果:', res); ```