Use this guide to add Vungle iOS SDK into your app, using AdMob as your main advertising mediation layer. AdMob iOS adapter v188.8.131.52 is compatible with Vungle iOS SDK v6.8.0 and has been tested with Google SDK v7.65.0 using Xcode 12.
Vungle iOS SDK is also available through CocoaPods. Add the following line in your project's pod file followed by a quick pod install run to update the project with the version of Vungle iOS SDK.
pod "VungleSDK-iOS", "6.8.0"
- Ad units set up on AdMob dashboard.
- Vungle App ID and Placement IDs created on Vungle dashboard and placement IDs are linked to ad units on AdMob dashboard.
- Set up the application with the right Xcode and iOS SDK version as detailed in the Vungle iOS integration document
- Vungle iOS SDK v.6.8.0 and Admob iOS adapter v.184.108.40.206 supports SKAdetwork and AppTrackingTransparency using Xcode 12.
Refer AdMob's integration document for detailed steps to setup Ad units and link Vungle's Placement IDs to ad units on AdMob dashboard.
IOS14: SKAdNetwork Support
The Vungle SDK v6.8.0 supports iOS 14 and SKAdNetwork 2.0. For IOS14 Readiness, a complete list of SKAdNetworkIDs, and code snippet to integrate SKAdNetworkIDs to plist file refer here.
Follow the steps to incorporate SKAdNetworkID:
- Inside the Project navigator in Xcode, open Info.plist file.
- Click on the Add Button(+) beside a key in a property list inside Info.plist file in order to create a new property key.
- Enter SKAdNetworkItems and choose Array in the type column.
- Add a dictionary item, then add a single string item inside the dictionary
- For the string item, add SKAdNetworkIdentifier as the key and the ad network identifier as the value.
As of July 1, 2020, California Consumer Privacy Act (CCPA) will be enforced and publishers must update to iOS SDK 6.7.0 and MoPub adapter 220.127.116.11 to comply with CCPA.
To pass CCPA values, you must call the Vungle SDK API directly. This is the only feature that should be accessed directly through Vungle SDK API. Other optional features should use
VungleRouterConfiguration class provided in the adapter.
updateCCPAStatus to set the user’s consent status to specify that the user has opted out by passing
updateCCPAStatus:VungleCCPADenied. And use
getCurrentCCPAStatus to get the current CCPA status for the particular user.
//To set the user's CCPA status to opt_out: [[VungleSDK sharedSDK] updateCCPAStatus:VungleCCPADenied]; //To find out what the user's current consent status is: [[VungleSDK sharedSDK] getCurrentCCPAStatus];
Before you begin to test the new adapter:
- Integrate the application with the latest adapter files and Vungle SDK.
- Update the Google Mobile Ads SDK to the latest version in the project.
Starting v6.5.1, we have expanded support for AdMob’s Banner Ads and support following 3 sizes:
|Size in points (WxH)||Description||AdSize constant|
|320 x 50||Banner||
|SCREEN_WIDTH x 32 | 50 | 90||Smart Banner||
|300 x 250||Medium Rectangle (MREC)||
Mobile: 320 x 50
Tablet: 728 x 90
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.
To display banner ad in the application, create an MREC placement on Vungle dashboard and link this placement to a Banner Ad unit on AdMob dashboard.
Presently, Vungle supports banner size 300*250 and should be specified as kGADAdSizeMediumRectangle as ad constant size in the implementation.
GADBannerView *bannerView = [[GADBannerView alloc] initWithAdSize:kGADAdSizeMediumRectangle]; [self addBannerViewToView:self.bannerView];
Loading, playing and closing the banner ad is detailed in the AdMob integration guide.
Multiple Banner Load
Vungle iOS 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 same AdMob Ad Unit ID for your banner placement 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.
VungleAdNetworkExtras *extras1 = [[VungleAdNetworkExtras alloc] init]; GADBannerView *bannerView1 = [[GADBannerView alloc] initWithAdSize:bannerSize]; bannerView1.adUnitID = @"AD_UNIT_ID" GADRequest *request1 = [GADRequest request]; [request1 registerAdNetworkExtras:extras1]; [bannerView1 loadRequest:request1]; VungleAdNetworkExtras *extras2 = [[VungleAdNetworkExtras alloc] init]; GADBannerView *bannerView2 = [[GADBannerView alloc] initWithAdSize:bannerSize]; bannerView2.adUnitID = @"AD_UNIT_ID_FOR_BANNER" GADRequest *request2 = [GADRequest request]; [request2 registerAdNetworkExtras:extras2]; [bannerView2 loadRequest:request2];
For SDK version 6.4.x onwards, publishers can now restrict from passing IDFV from the device to the SDK.
//Set the bool value YES to pass the IDFV from device to SDK [VungleRouterConfiguration setPublishIDFV:YES]; //Set the bool value NO to disable the IDFV collection from device to SDK [VungleRouterConfiguration setPublishIDFV:NO];
Starting from v6.4.x, you can prevent the SDK from requesting ads or even initializing if the storage of your iPhone falls below a predefined threshold.
//Integer value sets the required minimum available free storage space to be able to initialize the SDK [VungleRouterConfiguration setMinSpaceForInit:]; //Integer value sets the required minimum available free storage space to be able to request an Ad [VungleRouterConfiguration setMinSpaceForAdLoad:];
As documented by AdMob, starting from version 7.42.2 or higher, AdMob’s Rewarded Ads (New APIs), let’s you cache multiple ads at the same time for a single ad unit.
Since Vungle does not support this feature, the Ad request for the second “Load ad” will not be filled by Vungle, rather it will be passed to the next ad network in the waterfall.