Integrate Vungle SDK for iOS

Use this article to easily integrate the Vungle SDK for iOS, whether you are using Objective-C or Swift.

Before You Begin


  • The integration requires a Vungle account, so create a Vungle account if you haven’t already done so, and create a new iOS app in your account. Refer to the Add Your Apps and Placements section of our Using the Publisher Dashboard article to learn how to set up placements in the Vungle dashboard.
  • The Vungle iOS SDK v.6.9.2 supports Xcode 12 or higher as recommended by Apple.  Building on Xcode 11 or below is not supported.
  • We recommend using Xcode 12+ to archive your app.
  • The Vungle iOS SDK v.6.9.2 has been tested with the latest iOS version (iOS 14 as of the release date) and supports 64-bit apps.
  • Vungle iOS SDK v.6.9.2 supports applications that run on iOS 9 and higher. We do not recommend integrating the SDK in iOS versions lower than 9.0.
  • Vungle iOS SDK v.6.9.2 supports SKAdNetwork 2.0 and AppTrackingTransparency using Xcode 12.
  • For help answering the questions in Apple's App Store privacy questionnaire, refer to the data collection and use table in our Advanced Settings article.

Download the SDK

Download the Vungle SDK for iOS here: VungleSDK v.6.9.2.

Reference: Sample App and Source Code

Feel free to refer to the sample app we have provided as you integrate: The source code referenced here is available in our public GitHub repository:

Step 1. Add the Vungle Framework to Your Xcode Project

There are two ways to add Vungle to your Xcode project: using Cocoapods or manual integration.

Option 1. Cocoapods

The Vungle SDK is available through Cocoapods. Add the following into your project’s podfile:

pod "VungleSDK-iOS", "6.9.2"

After that, a quick pod install run will update your project with the latest version of our iOS SDK. At this point you can skip down to "Implement ATT Framework and Integrate SKAdNetwork IDs".

Note: For VungleSDK 6.9.2, Cocoapods requires a minimum version of 1.10.0 that provides pod support for XCFramework files. Testing was conducting using version 1.10.0+. 

In addition to the -ObjC flag be sure to add $(inherited) inside Other Linked Flags in the Build Settings

Option 2. Manual Integration

1. Add the VungleSDK.framework to Your Project

Download Vungle SDK v6.9.2. If you are updating from a previous version of the Vungle SDK, first remove the VungleSDK.framework or VungleSDK.xcframework directory completely before adding the new SDK.

Find the extracted files and drag the VungleSDK.framework or VungleSDK.xcframework directory into Xcode under Frameworks. Be sure to add the VungleSDK.framework or VungleSDK.xcframework folder as a group (yellow folder) and not as a reference (blue folder).

2. Add Other Required Frameworks

The Vungle SDK now ships with the build setting Link Frameworks Automatically set to YES; this means that you should no longer be required to link all the previously required frameworks and libraries (see below). With this update, you should only need to optionally link the following frameworks:

  • CoreFoundation.framework
  • Foundation.framework
  • StoreKit.framework

These previously required frameworks and libraries are included here so you can remove them if your project doesn’t reference any of them:

  • Support.framework
  • AudioToolbox.framework
  • AVFoundation.framework
  • CFNetwork.framework
  • CoreGraphics.framework
  • CoreMedia.framework
  • libz.dylib or libz.tbd
  • MediaPlayer.framework
  • QuartzCore.framework
  • StoreKit.framework
  • SystemConfiguration.framework

Note: Vungle SDK v.6.5.1+ does not support iOS 8 or lower. If you have iOS 7 as a deployment target, use Vungle iOS SDK v.4.1 or lower, and include these frameworks:

  • UIKit.framework
  • WebKit.framework
  • Foundation.framework

Confirm that the VungleSDK framework appears under Linked Frameworks and Libraries.

3. Add the “-ObjC” Linker Flag

Click on your project in Project Navigator and go to Build Settings → Linking → Other Linker Flags. Add -ObjC to Other Linker Flags.

Add SKAdNetwork IDs to Info.plist

Configure your app to participate in ad campaigns via the SKAdNetwork framework on iOS 14+. To do this, add the list of our approved partner IDs for advertising attribution to your Info.plist file. Adding the Vungle SKAdnetwork ID and the IDs of all the DSPs to whom you want to sell indicates that your app wants to work with Vungle and accept bids from these buyers.

Refer to Apple’s documentation on configuring the Info.plist properly for ad campaigns to be served. Refer also to the Xcode documentation for help on editing property lists.

Follow these steps to configure your app with SKAdNetworkIDs :

  1. Inside the Xcode Project navigator, open Info.plist file.
  2. Click the add button (+) next to a key in a property list inside the Info.plistfile in order to create a new property key. 
  3. Enter SKAdNetworkItems and select Array in the type column.
  4. Add a dictionary item, then add a single String item inside the dictionary.
  5. For each String item, add SKAdNetworkIdentifier as the key and the ad network identifier as the value.

Vungle hosts the Vungle SKAdNetwork ID and the list of our buyers' SKAdNetwork IDs in both JSON and XML formats on our website. Note that our lists are updated periodically:

Step 2. Add Code

Swift Only: Create a Bridging Header File

  1. Create a new Objective-C file in your project (File  New  File [Objective-C File]).
  2. When Xcode asks if you want to create a bridging header file between Objective-C and Swift, accept the prompt.
  3. Delete the new Objective-C file (${YOURPROJ}-Bridging-Header.m), but retain the bridging header file ${YOURPROJ}-Bridging-Header.h.
  4. In the Bridging header file, import the Vungle SDK by adding the following:
    #import <VungleSDK/VungleSDK.h>

Initialize the SDK

Initialize the SDK as soon as your app starts. If you are using a cache-optimized placement, initializing now gives the SDK enough time to cache an ad for that placement. You will need the App ID to initialize the SDK. You can find the App ID in the Vungle Dashboard.

- (BOOL)startWithAppId:(nonnull NSString *)appID error:(NSError **)error;

Sample code:

#import <VungleSDK/VungleSDK.h> 
NSError* error; 
NSString* appID = @"Your_AppID_Here"; 
VungleSDK* sdk = [VungleSDK sharedSDK]; 
if (![sdk startWithAppId:appID error:&error]) { 
  if (error) { 
    NSLog(@"Error encountered starting the VungleSDK: %@", error); 

Once the SDK is initialized successfully, the following callback method is called:

- (void)vungleSDKDidInitialize;

Refer to the Receive Delegate Callbacks section of the Advanced Settings article.

You can also check the status of the SDK initialization with the following property:

@property (atomic, readonly, getter=isInitialized) BOOL initialized;

Starting with Vungle SDK v.6.4.3, after initialization we automatically optimize the caching behaviors to maximize your monetization.

Once initialization is successful, watch for the vungleAdPlayabilityUpdate callback method to be called with the placement reference IDs matching your cache-optimized placement. (Refer to the Check Ad Availability for a Placement section when you follow the instructions to integrate any ad format.)

Swift Only: Create a Bridging Header File

  1. Create a new Objective-C file in your project (File  New  File [Objective-C File]).
  2. When Xcode asks if you want to create a bridging header file between Objective-C and Swift, accept the prompt.
  3. Delete the new Objective-C file (${YOURPROJ}-Bridging-Header.m), but retain the bridging header file ${YOURPROJ}-Bridging-Header.h.
  4. In the Bridging header file, import the Vungle SDK by adding the following:
    #import <VungleSDK/VungleSDK.h>

Integrate Ad Formats

Complete your SDK integration for each ad format you plan to display in your app. Refer to our instructions for each ad format:

Further Customize Your Ads

Follow the instructions in our Advanced Settings article to fine-tune your app's integration with additional configuration options, such as GDPR, CCPA implementation, and many other settings.

Powered by Creativity Driven by Performance Sign Up Here


Need further assistance, feel free to reach out to us, we’re here to help!

Was this article helpful?