SdkConfig
class SdkConfig
How the SDK is set up. Build one and hand it to CGS.init.
SdkConfig.Builder(context)
.environment(CgsEnvironment.PRODUCTION)
.productName("YOUR_PRODUCT_NAME")
.apiKey("YOUR_LICENSE_KEY")
.onSessionLost { promptSignIn() }
.build()Content copied to clipboard
The Context and a product name are required, and so is a license. The API key can come from the manifest instead:
<application ... >
<meta-data
android:name="co.cafeyn.cgs.license"
android:value="YOUR_LICENSE_KEY" />
</application>Content copied to clipboard
The configuration is read once, at CGS.init. Changing anything afterwards means CGS.shutdown and initializing again.