-
Notifications
You must be signed in to change notification settings - Fork 4
MoPub Mediation
To use PubNativeLite SDK directly in MoPub Mediation you will need to integrate the MoPub SDK and the PubNativeLite SDK into your app.
Download and install the MoPub iOS SDK as described in the MoPub Wiki.
To integrate the PubNativeLite SDK follow the instruction in the integration page.
To use the MoPub Adapter in your project, simply import PubnativeLite/PubnativeLiteDemo/Adapters/MoPubAdapter/Mediation file and all of its contents to your project.
To use the MoPub Adapter in your Swift project, ensure that you've imported PubnativeLite/PubnativeLiteDemo/Adapters/PNLite-Bridging-Header.h to your project and the Objective-C Bridging Header build setting under Swift Compiler - Code Generation has a path to the header
To set up the PubNativeLite Adapters in the MoPub mediation you need to follow a few steps.
If you already have an app and ad units created then you can skip those parts.
Create a new app in the MoPub Dashboard

Create a new ad unit and set up the format as Banner (320x50)

After this step, you will obtain an Ad Unit Id. Use this to request ads for this placement.

Create a new ad unit and set up the format as Medium (300x250)

After this step, you will obtain an Ad Unit Id. Use this to request ads for this placement.

Create a new ad unit and set up the format as Fullscreen

After this step, you will obtain an Ad Unit Id. Use this to request ads for this placement.

Create a new ad unit and set up the format as Native

After this step, you will obtain an Ad Unit Id. Use this to request ads for this placement.

Go to the Networks tab on the MoPub Dashboard. Select the option to add a new network. Select Custom SDK Network.



On the App and Ad Unit setup section of the network creation dialog, navigate the list of app all the way to the app and ad units where you want to set up PubNativeLite adapters.
Insert for each format the following custom event names and params:
-
Custom event for Banner:
PNLiteMoPubMediationBannerCustomEvent -
Custom event for MRect:
PNLiteMoPubMediationMRectCustomEvent -
Custom event for Interstitial:
PNLiteMoPubMediationInterstitialCustomEvent -
Custom event for Native:
PNLiteMoPubMediationNativeAdCustomEvent
Parameters to set up:
{
"pn_app_token": "<YOUR PUBNATIVE APP TOKEN>",
"pn_zone_id": "<YOUR PLACEMENT ZONE ID>"
}
After setting up the network. Activate it for the app in the Segments tab in the MoPub Dashboard

Set up the proper floor eCPM and make sure the network is enabled for all the required Ad units.

Ads should be requested using the regular MoPub process using the generated Ad Unit Ids. You can find the instructions in the MoPub developers page.