【问题标题】:Twilio Conversation LastReadMessageIndex Always null when you get connect with client first timeTwilio Conversation LastReadMessageIndex 首次与客户端连接时始终为空
【发布时间】:2021-08-13 11:50:24
【问题描述】:

我正在将 twilio 对话 API 用于聊天应用程序。我已从设置中启用读取水平。我正在标记消息已读索引并获得未读计数。但是当我刷新页面时,lastMessageRead 索引始终为空。我添加了更新和空的屏幕截图。我不认为它是什么 SDK 中的错误。我也在添加服务设置的屏幕截图。需要帮助我做错了什么。

【问题讨论】:

  • 您如何将这些对话加载到页面上以获取该属性。
  • 使用加入事件
  • 你能分享你正在使用的代码吗?
  • const Conversations = require('@twilio/conversations'); // 从服务器获取令牌 const client = await Conversations.Client.create(res.token); client.on('conversationJoined', throttle((conversation) => {}));
  • 是的,似乎它已修复,当我重新启动客户端时,我有索引。

标签: javascript twilio twilio-programmable-chat twilio-conversations


【解决方案1】:

如果你得到一个 conversationJoined 事件,这意味着你之前离开过它?

如果您在某个时候离开对话,阅读范围将被清除。

【讨论】:

  • 不,我不会离开它,我只是再次设置客户端。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-10-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-05-28
  • 1970-01-01
相关资源
最近更新 更多