Integrating the SDK with your app

Last updated on April 23, 2018

Note: Please make sure you are using the latest version of Xcode.

To manually integrate the SDK with your Xcode project:

  1. In Xcode, open your project and remove any previously installed versions of OpenXSDKCore.

  2. If you have any existing code integrating the SDK, compare the code samples and instructions in this documentation for each ad type to determine what you must change.

  3. Expand the zip file.

  4. Drag OpenXSDKCore.framework from the expanded zip file into your project.

  5. Verify that the Copy items into destination's group folder option is selected and click OK.

  6. Open your project's target settings.

  7. Remove the frameworks from Linked Frameworks and Libraries. Then, drag the SDK frameworks into Embedded Binaries. The frameworks should appear only once in the Linked Frameworks and Libraries and only once in Embedded Binaries.

  8. Select the Build Settings tab.

  9. In the Deployment Info section of the General tab, set Deployment Target for your app to 8.0 or higher. (iOS 8 is the minimum supported iOS release for the SDK.)

  10. For MRAIDMobile Rich Ad Interface Definitions, a type of API framework for interfacing between an ad creative and native mobile capabilities. ads, you should include all orientations you wish to support in your app’s info.plist file.

Initialize the SDK

Make sure to initialize the OpenX SDK early on in your app, as this ensures the SDK has more time for data enrichment, and ultimately this will help with monetization.

Initialize the SDK using OXMSDKConfiguration.

Swift


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
	OXMSDKConfiguration.initializeSDK()
}

Objective-C


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
	[OXMSDKConfiguration initializeSDK];
}

Now you are ready to integrate banner, interstitial, and video interstitial ads into your app. See also ATS support in iOS SDK.