0

I'm implementing group chat feature using Layer SDK. From the iOS SDK how can I fetch the LYRConversation instance using the conversation ID considering that I am not a part of that conversation.

LYRQuery class specifies that it runs the queries only on the conversations that I am a part of and hence are stored in my local database.

I'm fetching a list of layer conversation IDs from my backend API (as trending groups feature). There does not seem to be any API provided by Layer's iOS SDK to join another conversation based on it's conversation ID.

Is there a solution to this?

mohonish
  • 1,396
  • 1
  • 9
  • 21

1 Answers1

0

In the above mentioned case, we need to add the user to the conversation via the platform API (on our backend server).

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.

So to solve this issue, we made an API call to our backend server which added the user to the conversation. We also implemented waitForCreationOfObjectWithIdentifier to listen for when the conversation to which the user was added tp was synced to our local db, to inform the user about the same.

Thanks to layer support team for the quick clarification.

mohonish
  • 1,396
  • 1
  • 9
  • 21