GetSocial Android SDK Manual Initialization Guide
Disable Auto Initialization
By default, GetSocial SDK initializes automatically on application start. You can disable this behavior and initialize from code.
If you’re using GetSocial Gradle plugin, set
autoInit flag to
false in your
apply plugin: 'im.getsocial'
If you’re not using Gradle plugin, add
<meta-data> to your
<application> tag in
<application android:label="@string/app_name" ...>
<meta-data android:name="im.getsocial.sdk.AutoInitSdk" android:value="false"/>
Initialize From Code
To initialize GetSocial SDK from code, just call
Most of GetSocial APIs require initialized SDK. You can check SDK initialization state in sync or async way.
If you want to be notified about initialization complete, you can set a callback, that will be invoked when SDK gets initialized or invoked immediately if it is already initialized:
It can be useful when you want to use GetSocial on application start, but you can not be sure is it ready for use, for example, you want to retrieve referral data on application start:
Initialize With Dynamic Application Id
Also, you can specify application ID to initialize with from code:
Give us your feedback! Was this article helpful?