getInstance()
, init()
and getInitState()
.onCreate()
method of your Application
class. If you don't already have a custom application class, first create a new class that extends Application
.AndroidManifest.xml
onCreate()
method of your Application
class, call init()
and pass the SdkConfig
you created in the previous step, plus an instance of OnInitCallback
to handle the initialization result. onInitSuccess()
will be called. If it fails, onInitFailure()
will be called with an appropriate InitIssue
.init()
call must be executed before onCreate()
returns. Therefore, you must call it synchronously on the main thread. If you plan to add a remote flag to control the initialization (e.g. Firebase Remote Config), make sure the check is synchronous (e.g. using a cached flag).