AdMob Android adapter 22.214.171.124 is compatible with Vungle Android SDK 6.5.3 and has been tested for compatibility with Google Android SDK 19.0.0. Documentation for integrating AdMob Mediation with Vungle SDK resides on AdMob's Guide section, Integrating Vungle with Mediation, so use this guide as a supplement for the information about new features that are yet to be covered by the official documentation.
The instructions for Android Studio integration and manual integration can be found on AdMob's integration guide, Step 3: Import the Vungle SDK and Adapter.
If you are updating to Vungle Android SDK v6 using the Google Mobile Ads SDK, you must use Google Play Services Ads v12.0.0 or higher because we have added the
onRewardedVideoCompleted() callback method to
RewardedVideoAdListener. For more information, refer to the Google Mobile Ads SDK Release Notes.
Starting with v6.5.1, Vungle SDK supports AdMob’s banner ads. To display a banner ad in the application, create an MREC or banner placement on Vungle dashboard and configure this to a banner ad unit on AdMob dashboard. Please note that MREC (300dp x 250dp) must have a separate placement reference ID configured as MREC from Vungle dashboard, compared to other banner sizes that is configured as banner.
Supported banner sizes:
|Size in dp (WxH)||Description||AdSize constant|
|300x250||IAB Medium Rectangle||MEDIUM_RECTANGLE|
|Provided width x Adaptive height||Adaptive banner||N/A|
|Screen width x 32|50|90||Smart banner||SMART_BANNER|
AdView adView = new AdView(this); adViews.add(adView); adView.setAdSize(AdSize.MEDIUM_RECTANGLE); adView.setAdUnitId(<AdUnit>);
Multiple Banner Load
Vungle Android SDK 6.5.x supports one banner ad to be loaded for a placement ID at any given time and one placement ID is mapped to one AdMob ad unit ID. This limits the ability to succesfully load subsequent loadAd requests when a banner ad is already loaded by Vungle SDK. To overcome this limitation, you must pass a unique identifier (which can be a random number generated or simple incremental number) for each banner
loadAd so the request can fall back to next ad network in the waterfall when Vungle SDK already has a banner ad loaded.
Bundle extras = new VungleExtrasBuilder(null).setBannerUniqueRequestID("12345").build(); AdRequest adRequest = new AdRequest.Builder().addNetworkExtrasBundle(VungleInterstitialAdapter.class, extras).build(); adViewBanner.loadAd(adRequest);
Network Specific Parameters
The Vungle AdMob adapter continues to support network specific parameters as shown on AdMob's guide. Starting with v6.5.1, audio setting for video play has been replaced by
setStartMuted that takes a boolean and
setSoundEnabled has been deprecated. The adapter also supports an additional parameter
setAdOrientation to play the ad as per device orientation that takes an
AdConfig object with
MATCH_VIDEO configurability. (
setAutoRotate has been deprecated)
Bundle localExtras = new VungleExtrasBuilder(null) .setAdOrientation(AdConfig.LANDSCAPE) .setStartMuted(true) .setUserId("vungle-test-user") .setOrdinalViewCount(77777) .build();
For rewarded ads, you will pass
addNetworkExtrasBundle while you will pass
VungleInterstitial.class for interstitial ads.
Sample code for loading rewarded ads:
mRewardedAd.loadAd(new AdRequest.Builder() .addNetworkExtrasBundle(VungleAdapter.class, localExtras) .build(), adLoadCallback);
Sample code for loadinginterstitial ads:
mInterstitialAd.loadAd(new AdRequest.Builder() .addNetworkExtrasBundle(VungleInterstitialAdapter.class, localExtras) .build());
Starting with v6.4.11, you can prevent the SDK from requesting ads or even initializing if the storage of your Android device falls below a predefined threshold in bytes. If this happens, you will get an error similar to the following:
There is not enough file system size on the device.
import com.vungle.mediation.VungleNetworkSettings; long minimumSpaceForInit = 50000l; long minimumSpaceForAdLoad = 55000l; // setMinSpaceForInit and setMinSpaceForAdLoad takes a long for available space in bytes VungleNetworkSettings.setMinSpaceForInit(minimumSpaceForInit); VungleNetworkSettings.setMinSpaceForAdLoad(minimumSpaceForAdLoad);
Starting with v6.4.11, publishers can now restrict from passing Android ID from the device to the SDK.
New Rewarded API
As documented in AdMob instruction guide, v17.2.0 and higher supports caching multiple rewarded ads at the same time. Since Vungle does not support this feature, the ad request for the second load attempt won't be filled by Vungle, rather it will be passed to the next ad network in the waterfall.
We recommend that you use cache optimized placement if you want to have more than one ad cached since ad request will be automatically made at the time of ad play, then next ad is highly likely to be ready to be played by the time previous ad experience ends.