RongIMLib View Markdown
    Preparing search index...

    Function getMessagesAroundTimestamp

    • 获取本地指定时间戳前后 N 条消息方法

      Parameters

      • conversation: IConversationIdentifier

        会话信息

      • option: { timestamp: number; beforeCount: number; afterCount: number }

        获取参数

      Returns Promise<RCResult<IAReceivedMessage[]>>

      本接口仅适用 Electron 平台,获取本地指定时间戳前后 N 条消息

      5.9.8

      获取本地指定时间戳前后 N 条消息示例:

      const conversation = {
      conversationType: RongIMLib.ConversationType.PRIVATE,
      targetId: 'targetId',
      };
      const option = {
      timestamp: 0,
      beforeCount: 10,
      afterCount: 10,
      };
      const res = await RongIMLib.electronExtension.getMessagesAroundTimestamp(conversation, option);
      console.info('获取本地指定时间戳前后 N 条消息结果:', res);