Banner integration

Last updated on July 16, 2018

Overview

Prerequisites

Integration

Objective-C code sample

Swift code sample

Prerequisites

Before integrating a bannerThis is an ad that appears on a web page which is typically hyperlinked to an advertiser’s website. Banners can be images (GIF, JPEG, PNG), JavaScript programs or multimedia objects (For example, Java). 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 OXMBannerView in Interface Builder before following the steps below.

  1. In your view controller, import OpenXSDKCore.

  2. Conform your view controller to the OXMBannerViewDelegate protocol.

  3. Create a variable to reference OXMBannerView 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. Call load() on the OXMBannerView.
  6. Implement the OXMBannerViewDelegate methods.
  7. If you want to use flex ads to allow multiple ad sizes for an ad unit, see Flex ads.

Objective-C code sample

Swift code sample

Fill out my online form.