Opt-in video integration

Last updated on October 29, 2018

Opt-in videoA type of linear video ad or ad unit associated with mobile apps. A user opts into watching a full-screen, non-skippable video ad in exchange for a non-liquid, in-app reward after viewing the entire ad. Examples of rewards are: access to premium content or features, an extra life, continued play, a coupon, a discount code, or something else without monetary value. Opt-in video is also known as rewarded video and is not the same as incentivized video. in the OpenX Mobile iOS SDK is in Beta release only. For more information, contact OpenX.

If you are participating in the Beta, you can integrate opt-in video ads in the OpenX Mobile iOS SDK. The supported video ad formats include .mp4, .3gpp, .webm, and .mkv.

Overview

Prerequisites

Integration

Objective-C code sample

Swift code sample

Prerequisites

Before integrating an opt-in video (rewarded video) ad in your app, please do the following:

  1. Either create a linear video ad unit with the Is Rewarded check box selected 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 adUnitIdentifierType to AdUnitIdentifierTypeVast.
    2. Set vastURL using the URL from your video ad unit. Please note that a VAST tag always looks like this: "DOMAIN/v/1.0/av?auid=AUID" (where DOMAIN is your OpenX delivery domainThe domain on which ads will be served for your OpenX inventory. OpenX Partner Services provide this to you so you can set up your implementation. For example: PUBLISHER-d.openx.net., and AUID is the OpenX ad unit ID).
    3. Assign delegate and set it to self.
    4. Set autoDisplayOnLoad to false.
    5. (Recommended) Enrich the request by setting values on the userParameters property.

    Note: OpenX SDK preloads video content by default.

  5.  

  6. To set the ad unit as an opt-in video, set the isRewarded flag to YES.
  7. Call load() on OXMInterstitialController.
  8. Implement the OXMInterstitialControllerDelegate methods.
  9. Display the opt-in video.

Objective-C code sample

Swift code sample

Fill out my online form.