MoPub SDK adapter

Last updated on May 7, 2018

If you want to use OpenX as a source of demand on MoPub via the MoPub SDK, you can build an adapter to integrate the OpenX Mobile iOS SDK with the MoPub SDK.

To help you quickly build your adapter, OpenX provides sample adapter code for 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). and interstitialA full-screen ad displayed in content transitions. For example, a video ad that loads between levels of a mobile game. ads in the MoPub adapter sample app. The sample adapters are built according to MoPub's instructions. You will need to customize the adapters to meet your needs.

  1. Add the OpenXCoreSDK.framework to your project.
  2. Add the MoPub SDK to your project according to MoPub's instructions.
  3. Add the OpenX MoPub adapters to your project:
    • OXMMoPubBannerAdapter.m and OXMMoPubBannerAdapter.h

    • OXMMoPubInterstitialAdapter.m and OXMMoPubInterstitialAdapter.h

    • OXMMoPubVideoInterstitialAdapter.m and OXMMoPubVideoInterstitialAdapter.h

  4. In the MoPub web interface, in an order, create a network line itemThe primary unit of execution for an order, which represents a specific inventory purchase and the required conditions for ad delivery. using the Custom Native Network type. In the Custom Class field, enter the class name of your custom event (for example, OXMMoPubBannerAdapter).
  5. In the Data field, please use the following format:
    						"AD_UNIT_ID": "[OPENX AD UNIT]", 

    For example:

    						"AD_UNIT_ID": "123456789", 
    						"AD_DOMAIN": ""
  6. Select the app and ad unitThe smallest inventory component that represents the space on a site where ads display. for the line item to target.
  7. If using multiple adapters (such as banner, and interstitial, and video), create a separate line item for each adapter.