ios – TwilioConversationsClient not returning conversation for SID


I’m developing a chat app in Swift. I am following the Quickstart found here: https://www.twilio.com/docs/conversations/ios/exploring-conversations-swift-quickstart#joining-a-conversation

I have 2 devices and I’m trying to get them to join a conversation and chat with eachother. I’m able to successfully get one device into the conversation and sending messagse.

When I launch the app on a 2nd device, and try to join the same conversation, I get an error, but I’m expecting a conversation. Here is the code that returns the error:

// uniqueConversationName = "general"

client.conversation(withSidOrUniqueName: uniqueConversationName) { (result, conversation) in
            if let error = result.error {
                print(error)
            }
            
            completion(result, conversation)
        }

The conversation is nil and the error is:
Error Domain=signal.sdk.domain.error Code=50430 "User not participant of conversation" UserInfo={kTCHErrorMsgKey=User not participant of conversation

I know that the user is not a participant of the conversation yet – I want to retrieve the conversation and then using the conversation object, I will join the participant.

With this current state, I can never add a 2nd participant to the conversation.

Why is this error being thrown and how can I fix this?

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img