RongIMLib View Markdown
    Preparing search index...

    Function sendSyncReadStatusMessage

    • 多端同步阅读状态

      Parameters

      • conversation: IConversationIdentifier

        会话信息

      • timestamp: number

        需要同步消息阅读的时间戳,可以在消息体中通过消息的 sendTime 获取

      Returns Promise<RCResult<void>>

      由于未读消息数存储在本地,服务器不存未读消息数量。当用户多端登录时,需要同步未读消息数以保证多端未读数一致

      多端同步阅读状态示例:

      const conversation = {
      conversationType: RongIMLib.ConversationType.PRIVATE,
      targetId: 'targetId',
      }
      const timestamp = 1632728573423; // 阅读消息的 sendTime
      const syncReadStatusRes = await RongIMLib.sendSyncReadStatusMessage(conversation, timestamp);
      console.info('多端同步阅读状态:', syncReadStatusRes);