Basics of the improved Sendbird UIKit initialization. #86
tezpark
announced in
8. Commons
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Basics of the improved Sendbird UIKit initialization.
To integrate and run Sendbird UIKit in your app, you need to first initialize the
SendbirdUI
instance throughAppDelegate
.If you haven't modified the initialization parameters,
InitParams
, Sendbird UIKit works based on local caching and synchronization and won't proceed to the next step until the initialization is complete. We recommend displaying a loading indicator to show the initialization process so that other succeeding steps should wait. The indicator should be displayed whenstartHandler
is called and hidden whencompletionHandler
is called.The
initParamsBuilder
of theinitialize(applicationId:initParamsBuilder:migrationHandler:completionHandler:)
function of theSendbirdUI
class allows you to modify the use of local caching and the synchronization settings of the initialization task.If you are using local caching but don't need to use SendbirdUIKit's features immediately after launching your app, you can make the migration process of local caching asynchronous by setting the
needsSynchronous
parameter of theInitParams
object tofalse
. This will reduce the initialization time when the app is launched to minimize runtime. (If you don't use local caching, there's no difference in app launching time because there's no migration process).Also, if you have a situation where a SendbirdUIKit's function is called asynchronously from another class or method, independent of SendbirdChat's initialization, use the SendbirdChat class's
executeOrWaitForInitialization(executeHandler:)
feature.You can set it to execute immediately if it's initialized, or wait for initialization if it's not.
Sequence diagram
Below is a sequence diagram to help you understand.
Synchronous
Asynchronous
Beta Was this translation helpful? Give feedback.
All reactions