GetSocial iOS SDK Manual Initialization Guide¶
Disable Auto Initialization¶
By default GetSocial SDK is initialized automatically on application start. You can disable this behavior and initialize from code.
Using getsocial.json
file¶
- Open
getsocial.json
file. -
Set
autoInit
property tofalse
:... "autoInit": false, ...
Initialize From Code¶
To initialize GetSocial SDK from code, just call GetSocial.initSdk()
.
Most of GetSocial APIs require initialized SDK. You can check SDK initialization state in sync or async way.
if GetSocial.isInitialized() {
// use GetSocial
}
If you want to be notified about initialization complete, you can add a listener, that will be invoked when SDK gets initialized or invoked immediately if it is already initialized:
GetSocial.addOnInitializedListener(() => {
// GetSocial is ready to be used
});
Initialize With Dynamic Application Id¶
Also, you can specify application ID to initialize with from code:
const appId = '<APP_ID>'
GetSocial.initSdk(appId);