Initialize Mediation

Add the Import Header

Add the following import header to the top of any class file that will be using a Mediation class:

#import <HeliumSdk/HeliumSdk.h>

Initialize Mediation

Using the Mediation AppId and Mediation AppSignature from your Helium Dashboard setup, initialize the Mediation SDK with the following code:

[[HeliumSdk sharedHelium] startWithAppId:@"MYHELIUMAPPID" andAppSignature:@"MYHELIUMAPPSIGNATURE" delegate:self]

Make sure that these are the Mediation AppId and AppSignature values that you obtain directly from your Mediation Dashboard for your app as opposed to credentials from Chartboost or any other Ad Network.

You can implement the HeliumSdkDelegate in your class to receive notifications about the success or failure of the SDK initialization. See iOS: Delegate Usage for more details.

Once the Mediation SDK has successfully started, you can start showing ads.

Advanced Settings

Initialization Metrics

The Mediation SDK contains an optional callback for receiving SDK initialization metrics in a JSON format. To utilize the API, use the following code snippets:

// Subscribing to Mediation SDK initialization results.
NotificationCenter.default.addObserver(forName: .heliumDidReceiveInitResults, object: nil, queue: nil) { notification in
  // Extract the results JSON payload.
  let results = notification.object as? [String: Any]
}

Network Kill Switch

The Mediation SDK initialization method has been expanded to take in optional initialization parameters. One of those parameters is a set of network adapter identifiers to skip initialization for the session.

🚧

Warning

Do not disable the Chartboost network or else the Mediation SDK will not initialize.

// Create Mediation SDK options to disable specific networks
let options = HeliumInitializationOptions(skippedPartnerIdentifiers: ["network_identifier", "network_identifier2"])
let helium = Helium.shared()
helium.start(withAppId: "appIdentifier", andAppSignature: "appSignature", options: options, delegate: self)