Skip to content
Can Soykarafakılı edited this page Aug 24, 2018 · 20 revisions

To use PubNativeLite SDK directly in MoPub Mediation you will need to integrate the MoPub SDK and the PubNativeLite SDK into your app.

Integrate MoPub SDK

Download and install the MoPub iOS SDK as described in the MoPub Wiki.

Integrate PubNativeLite SDK

To integrate the PubNativeLite SDK follow the instruction in the integration page.

Integrate The MoPub Adapter

To use the MoPub Adapter in your project, simply import PubnativeLite/PubnativeLiteDemo/Adapters/MoPubAdapter/Mediation file and all of its contents to your project.

Swift Integration

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

Set Up Network on MoPub Dashboard

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 an App

Create a new app in the MoPub Dashboard

Create Banner Ad Unit

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 Medium Ad Unit

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 Interstitial Ad Unit

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 Native Ad Unit

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.

Create PubNative Mediation Network

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.

Request ads

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.

Home

Installations & Configurations

Displaying Ads with HyBid

Displaying Ads with Header Bidding with GAM

Mediation

Advanced Setup

Integration Checklists for Publishers

Misc

Clone this wiki locally