Nonstop Swift SDK

Initialization

Initialize the Nonstop SDK in your AppDelegate.

Initialization

The initialize method takes a Nonstop config as a parameter.

You can supply NonstopConfig with no values set and it will default to no Amplitude tracking and hitting the Dev Nonstop environment.

  • Optionally you can pass an Amplitude API Key and this will be used to report build in Amplitude events to.
  • Optionally you can pass an Environment Enum, this will determine which Nonstop Environment API the SDK uses.

Use defaults

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    // Override point for customization after application launch.
    let config = NonstopConfig()
    Nonstop.sharedInstance.initialize(with: config)
    return true
}

Specify Values

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    // Override point for customization after application launch.
    let config = NonstopConfig(amplitudeApiKey: "4d2b68c10cb3c95f6535b76aebcacdf2",  environment: .Staging)
    Nonstop.sharedInstance.initialize(with: config)
    return true
}

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