twilio / conversations-ios

SPM releases

Home Page:https://www.twilio.com/docs/conversations/ios/changelog

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash [TwilioConversationsClient initializeClientWithConfig:token:properties:completion:]

khanhson47 opened this issue · comments

Hi, I'm getting crashes from Crashlytics, I don't know why it's happening and I cannot reproduce it as well.
Please help me check this. Thank you in advance.
Screen Shot 2022-05-13 at 15 07 22

Hello,

Can you open a support ticket and give a sample how you create the client? Please make a reference to this issue in the ticket.

It always redirects me to https://support.twilio.com/hc/en-us. How can I create a support ticket?

Here is how I create the client

func loginTwilio(completion: @escaping (Bool) -> Void) {
    getTwilioToken { [weak self] isSuccess in
        guard let self = self else { return }
        guard isSuccess, let token = self.token else {
            completion(false)
            return
        }

        let properties = TwilioConversationsClientProperties()
        TwilioConversationsClient.conversationsClient(withToken: token, properties: properties, delegate: self) { [weak self] result, twilioClient in
            guard let self = self else { return }
            guard result.isSuccessful else {
                completion(false)
                return
            }

            self.client = twilioClient
            if let twilioClient = self.client, twilioClient.user != nil, let deviceTokenData = Defaults[\.deviceTokenData] {
                self.clientRegisterPushNotification(client: twilioClient, token: deviceTokenData)
            }
            completion(true)
        }
    }
}

Hello again,

Thank you for the code sample. We are currently investigating the issue now. In the meanwhile I would like to ask you to open a support ticket using this link: http://twilio.com/console/support/tickets/create

Previous one should work too, but it turned out you need to be logged in to the Console.

@Gray-Wind Any update on this crash? We're starting to see it on iOS 15.6+. 80% of them are happening in the background.

During the internal investigation we found out that this crash could happen during fast initialization-deinitialization process.

Looking to the code example provided above, I would say it could happen if loginTwilio function would be called twice in a short period of time.

We have now a little hot fix in works, it will be published soon.

Hello, take a look at just released version v2.2.5.

Looks like I can close the ticket now, if you have any issues feel free to create a new one.