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 Installer Script

If you are using GetSocial Installer script, to disable auto initialization:

  1. In your Xcode project, open Project settings and select target you want to modify.
  2. Go to Build Phases tab → Run Script section:

    1
    ./getsocial-sdk7.sh --app-id="your-getsocial-app-id"
    

Using getsocial.json file

  1. Open getsocial.json file.
  2. Set autoInit property to false:

    1
    2
    3
    ...
    "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.

1
2
3
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:

1
2
3
GetSocial.addOnInitializedListener {
    // GetSocial is ready to be used
})

Initialize With Dynamic Application Id

Also, you can specify application ID to initialize with from code:

1
2
let appId = "<APP_ID>"
GetSocial.initSdk(appId: appId)

Give us your feedback! Was this article helpful?

😀 🙁