This guide is intended for publishers who are interested in serving:
- Banner Ads
- MRect Ads
- Fullscreen Interstitials
from PubNative using the Admob mediation network. This document will include help the setting up of the mediation adapter with your Android application.
Requirements
- AdMob Android SDK
- PubNative Android iOS Adapter
- An App Token obtained from PubNative Dashboard
- A Placement Name configured and obtained from the PubNative Dashboard
Note: At the moment, this adapter project is supporting the versions down below:
- Pubnative SDK: 2.0.11
- AdMob:10.2.6
- Android:Min API level 15
Install AdMob Android SDK
Download and install the AdMob Android SDK as described in the documentation.
Install PubNative AdMob Android Adapter
Gradle
The PubNative Admob Adapter is available via jCenter. To add the sdk dependency, open your project's build.gradle and update the repositories and dependencies blocks as follows:
repositories {
// ... other project repositories
jcenter()
}
// ...
dependencies {
// ... other project dependencies
compile 'net.pubnative:adapters.admob:10.2.6-2.0.11'
}
The adapter library includes the Pubnative Android SDK. So there's no need to import it as an extra step.
Proguard
If you are using Proguard for you Android builds then you should add the following lines to your proguard file:
-keepattributes Signature
-keep class net.pubnative.** { *; }
Adding a Custom Event of Interstitial in AdMob
-
Sign in to your Admob account
-
Choose an application to configure mediation
-
Create new Ad Unit
-
Go to Mediation section
-
Create a new mediation or modify existing one
-
Choose an Interstitial type
-
Add new Custom Event
-
Setup all parameters as you want at next screen, and go to next
-
Enter class name
net.pubnative.sdk.adapters.admob.PNInterstitialAdapter
- In parameters add the string with app token and placement name, like this: {"app_token":<YOUR_APP_TOKEN>,"placement":<PLACEMENT_NAME>}
Adding a Custom Event of Banner or MRect in AdMob
-
Sign in to your Admob account
-
Choose an application to configure mediation
-
Create new Ad Unit
-
Go to Mediation section
-
Create a new mediation or modify existing one
-
Choose a Banner type
-
Add new Custom Event
-
Setup all parameters as you want at next screen, and go to next
-
Enter class name
net.pubnative.sdk.adapters.admob.PNBannerAdapter
- In parameters add the string with app token and placement name, like this: {"app_token":<YOUR_APP_TOKEN>,"placement":<PLACEMENT_NAME>}