Interstitial integration

Last updated on July 16, 2018

Overview

Prerequisites

Integration

Objective-C code sample

Swift code sample

Prerequisites

Before integrating an interstitialA full-screen ad displayed in content transitions. For example, a video ad that loads between levels of a mobile game. ad in your app, please do the following:

  1. Either create a mobile ad unit or make sure you know which existing ad unitThe smallest inventory component that represents the space on a site where ads display. to use.
  2. Complete the integration steps, as described in Integrating the SDK with your app.

Integration

Note: If you are using Interface Builder to assist with your ad integration, set up OXMInterstitialController in Interface Builder before following the steps below.

  1. In your view controller, import OpenXSDKCore.

  2. Conform your view controller to the OXMInterstitialControllerDelegate protocol.

  3. Create a variable to reference OXMInterstitialController and instantiate it.

  4. In your view controller, set parameters in the viewDidLoad method:

    1. Set the adUnitID.
    2. Set the domain.
    3. Assign the delegate and set it to self.
    4. (Recommended) Enrich the request by setting values on the userParameters property.
    5. Set autoDisplayOnLoad to false.
  5. Call load() on the OXMInterstitialController.

  6. Implement the OXMInterstitialControllerDelegate methods.

  7. If you want to use flex ads to allow multiple ad sizes for an ad unit, use the flexAdSize parameter. For details, see Flex ads.

  8. Display the interstitial.

Swift code sample

Objective-C code sample

Fill out my online form.