iOS: Correct initialisation

SendbirdUI Version: 3.2.2
:raised_hand:

I have had problems with the initialization of SendbirdUI.
I followed the documentation on how you should initialize Sendbird using SPM but I saw that the initialization produces crashes in our production version.

I am wondering if it is a bad idea to initialize SendbirdUI and SendbirdChat at the same time.

        SendbirdUI.initialize(applicationId: applicationID) { [weak self] error in
            if let error = error {
                print("SendbirdUI initialisation: \(String(describing: error))")
            }
            SendbirdUI.setLogLevel(.none)
        }

       let initParams = InitParams(applicationId: applicationID, logLevel: .none)
        if let error = SendbirdChat.initializeSynchronously(params: initParams) {
            print("SendbirdChat initialisation: \(String(describing: error))")
        }

I decided to go this way because in some of the tests I did with the SendbirdUI initiation, some users had no channel available and all their messages were lost but by adding the SendbirdChat initiation this problem was solved.

@margaret what kind of crashes were you having?
I’m also having some random issue on production where I have users with a crash on SendbirdChat Database.swift.

Hi @plopes,
My error was in SendbirdManager.initializeSendbirdChat()

@plopes were you able to tackle this crash?

According to an email thread that I’ve with sendbird this was fixed in Sendbird Chat v4.8.1
I haven’t try this as I’ve been off and will do this update in our next release