Mopub iOS Adapter


This document describes the procedure for serving (Formerly StartApp) Ads in your iOS application using MoPub as the mediation network

  • The code samples in this document can be copy/pasted into your source code
  • Feel free to take a look at our Sample Project to help you during the integration process
  • If you have any questions, contact us here.

Prerequisite for adapter integration:

MoPub is set as your mediation network

The following manual assumes that you are already familiar with the MoPub Mediation Network and have already integrated the MoPub Android SDK into your application with at least one Ad Unit. 
Otherwise, please start by reading the following articles for a walk-through explanation of what mediation is, how to use the MoPub Mediation UI, and instructions on how to add MoPub mediation code into your app.

You application is defined in your Account

At this point we assume that you have already added your application to your (Formerly StartApp) account, in case you haven't, please follow the next steps:

  1. Login into your Publisher's account
  2. Add your application and get its App ID

For any questions or difficulties during this process, please contact us here.

Step 1, Integrating the MoPub Mediation iOS Adapter + SDK as dependency

The easiest way is to use CocoaPods, just add to your Podfile the dependency

pod 'startio-mopub-mediation'

If you don't use Cocopods, you can use this source code from Github and add it to your project

In such case you will have to integrate our iOS SDK separately using the following iOS SDK integration instructions


Step 2, Adding a Custom Event

  1. Login into your MoPub account
  2. Navigate to "Orders" tab and click "Create Order"



3. After Saving Create your Line Item and set it up to:

  • Type: "Network Line Item" 
  • Network: "Custom SDK Network"


4. Under the fields "Custom event class" and "Custom event data" add the below based on the AdType you are looking to monetize:

  • Don't forget to replace "your_id_from_portal" with your App ID
Ad Type Custom event class Custom event data Options
Interstitial StartioMopubFullscreenAdapter {"startioAppId":"your_id_from_portal", "adTag":"any_your_tag", "interstitialMode":"OVERLAY", "minCPM":0.02} interstitialMode can be OVERLAY or VIDEO
Banner/Medium Rectangle StartioMopubInlineAdapter {"startioAppId":"your_id_from_portal", "adTag":"any_your_tag", "minCPM":0.02}  
Rewarded StartioMopubRewardedAdapter {"startioAppId":"your_id_from_portal", "adTag":"any_your_tag", "minCPM":0.02}  
Native StartioMopubNativeCustomEvent {"startioAppId":"your_id_from_portal", "adTag":"any_your_tag", "minCPM":0.02, "nativeImageSize":"SIZE150X150", "nativeSecondaryImageSize":"SIZE100X100"} nativeImageSize and nativeSecondaryImageSize can be any of SIZE72X72, SIZE100X100, SIZE150X150, SIZE340X340, SIZE1200X628, SIZE320X480, SIZE480X320 and don't forget to add StartioMopubNativeCustomEvent string to your renderer settings in the field ".supportedCustomEvents"


All parameters in the "custom event data" field are optional except the "startioAppId" which you must provide in any case. You can also pass these parameters from your code using mopub's "localExtras" field. But be aware that every parameter from "custom event data" will override same parameter which is set locally


self.interstitial.localExtras = @{
    @"adTag": @"myCustomTag",
    @"minCPM": @0.01,
[self.interstitial loadAd];


7. Click "Next" to Select the relevant Apps and Ad Units and then the Audience targeting as you require. 

8. Save your Line Item and make sure it's status is "Enabled".

Step 3, Testing Your Application

Congratulation - that's it! You may now run your app and see StartApp) ads in action.