Integrating MoPub + Vungle SDK v.6 (iOS)

Use this guide to add Vungle iOS SDK into your app, using MoPub as your main advertising mediation layer. MoPub iOS adapter 6.3.2 is compatible with Vungle iOS SDK 6.3.2.


Before You Begin

Step 1. Set Up Vungle as an SDK Network or as a Custom Native Network

Set Up Vungle as an SDK Network

  1. Log in to the MoPub dashboard and select Networks from the main navigation panel.

  2. Click New Network.

    and select Vungle.

  3. In the Network Settings section, if you Enable reporting access, enter your Reporting API Key from the Vungle Dashboard.

  4. In App & Ad Unit Setup, enter the Vungle Application ID and Placement Reference IDs.


Set Up Vungle as a Custom Native Network

To ensure that the MoPub servers recognize the integrated Vungle Adapters, set up Vungle as a Custom Native Network in the MoPub dashboard.

  1. Log into the MoPub dashboard, and navigate to Networks by the main navigation bar.

  2. Click New Network button on the top right.

    and select Vungle from the list.

  3. After creating Vungle as a Network, click on the name from the list of Networks. In the Set Up Your Inventory section, for each ad unit that will use the Vungle SDK to present video ads, ensure that the MoPub SDK can find the network adapter used to interact with the Vungle SDK:


    • If you are using MoPub Rewarded Video​ for an Ad Unit, add VungleRewardedVideoCustomEvent under the Custom Event Class​ section.

    • If you are using Interstitial for an Ad Unit, add VungleInterstitialCustomEvent under the Custom Event Class.

    • Add your Vungle App ID, placement reference ID of the placement to be called from the ad unit, and all placement reference IDs in JSON format under the Custom Event Class Data.

    • Set the placement reference ID you want to link to the MoPub Ad Unit for pid.

    • Make sure to link a placement that is set to rewarded type at Vungle dashboard to the MoPub Ad Unit that is set to Rewarded Video​; and link a placement that is set to interstitial type at Vungle dashboard to the MoPub Ad Unit that is set to Fullscreen (320 x 480).

      Note: The Vungle SDK will cache an ad automatically for the placement you selected to be Auto Cached​ in the Vungle Dashboard. We highly recommend selecting the MoPub Ad Unit shown first or the Ad Unit shown most frequently as the Auto Cached placement.

Step 2. Add Vungle as a Third-Party Ad Network

To add the Vungle iOS SDK into your app using MoPub mediation:

  1. Add all the Vungle-related adapter files (under /AdNetworkSupport/Vungle/ in the MoPub Adapter Repository) to your app’s project and make sure they are included in the project's Build Phases → Compile Sources.
  2. Download the Vungle iOS SDK and copy the VungleSDK.framework folder into  /AdNetworkSupport/Vungle/SDK/.

    • Make sure the project's Build Settings → Framework Search Path includes the framework. For example:
    • Make sure the framework is included in the project's Build Phases → Link Binary With Libraries.

  3. Follow the instructions in the “Add Other Required Frameworks“ section of “Get Started with Vungle - iOS SDK“ to add the necessary frameworks.

  4. Follow the instructions in the “Add the “-ObjC” Linker Flag“ section of “Get Started with Vungle - iOS SDK“ to add the linker flag.

  5. Follow the instructions in the “Remove the iOS Status Bar“ section of “Get Started with Vungle - iOS SDK“ to remove the status bar.

  6. Call the MPInterstitialAdController’s showFromViewController method (or, for rewarded ads, call the  MPRewardedVideo's presentRewardedVideoAdForAdUnitID method) when you want to present a Vungle video ad! (No need to call the Vungle iOS SDK methods directly. The MoPub SDK will do it.)



Was this article helpful?


Need further assistance, feel free to reach out to us, we’re here to help!