如何在 layer sdk 中加入带有对话 ID 的现有对话?
How to join an existing conversation with conversation ID in layer sdk?
我正在使用 Layer SDK 实现群聊功能。从 iOS SDK 考虑到我不是该对话的一部分,我如何使用对话 ID 获取 LYRConversation 实例。
LYRQuery class 指定它仅对我参与的对话运行查询,因此存储在我的本地数据库中。
我正在从我的后端 API 获取层对话 ID 列表(作为趋势组功能)。 Layer 的 iOS SDK 似乎没有提供任何 API 来根据对话 ID 加入另一个对话。
有解决办法吗?
在上述情况下,我们需要通过平台API(在我们的后端服务器上)将用户添加到对话中。
The sync will happen near instantaneously. We also have a newer method called waitForCreationOfObjectWithIdentifier https://developer.layer.com/docs/ios/api#lyrclient
that will let you specify an object id and then it will trigger as soon as that object has synced.
因此,为了解决这个问题,我们对后端服务器进行了 API 调用,将用户添加到对话中。我们还实现了 waitForCreationOfObjectWithIdentifier 来监听添加了用户的对话何时同步到我们的本地数据库,以通知用户。
感谢 layer support 团队的快速澄清。
我正在使用 Layer SDK 实现群聊功能。从 iOS SDK 考虑到我不是该对话的一部分,我如何使用对话 ID 获取 LYRConversation 实例。
LYRQuery class 指定它仅对我参与的对话运行查询,因此存储在我的本地数据库中。
我正在从我的后端 API 获取层对话 ID 列表(作为趋势组功能)。 Layer 的 iOS SDK 似乎没有提供任何 API 来根据对话 ID 加入另一个对话。
有解决办法吗?
在上述情况下,我们需要通过平台API(在我们的后端服务器上)将用户添加到对话中。
The sync will happen near instantaneously. We also have a newer method called waitForCreationOfObjectWithIdentifier https://developer.layer.com/docs/ios/api#lyrclient that will let you specify an object id and then it will trigger as soon as that object has synced.
因此,为了解决这个问题,我们对后端服务器进行了 API 调用,将用户添加到对话中。我们还实现了 waitForCreationOfObjectWithIdentifier 来监听添加了用户的对话何时同步到我们的本地数据库,以通知用户。
感谢 layer support 团队的快速澄清。