Nonstop Kotlin SDK

Initialization

Initialize the Nonstop SDK in your Application class' OnCreate method

Initialization

The initialize method takes several configuration parameters.

  • The SDK needs a reference to the AppContext - this should be passed as the first parameter
  • The SDK will perform some internal Amplitude tracking - the Amplitude API key it should be used should be passed as the second parameter. (Note passing an empty string here will disable Amplitude tracking)
  • The SDK needs to know which Nonstop API Environment to use - this should be passed as the third parameter.
  • The SDK needs to know which platform it is being run on - both for reporting to Nonstop and also for reporting to Amplitude. This should be passed as the fourth parameter. Valid values are ANDROID, KINDLE, FIRETV and ANDROID_TV.

Example

class App : Application() {
    override fun onCreate() {
        super.onCreate()
        Nonstop.init(this, BuildConfig.AmplitudeApiKey, Environment.STAGING, Platform.ANDROID)
    }
}

Environments

The Environments parameter controls which APIs the SDK will hit, and thus which Nonstop Admin and ShowMS Environment is tied to them. Developers should be conscious of this and match their Nonstop Environment to their ShowMS environment for the given build.

Reward Animations

Note: The Nonstop SDK will asynchronously preload reward animations on initialize for improved performance when they are required so you may see this network call on app start.

In this document