Integrate Vungle SDK for iOS

This guide is for publishers who want to monetize an iOS app with Liftoff. Integrating the Vungle SDK into your app is the first step toward displaying ads and earning revenue. Once you've integrated the SDK, you can proceed to implement one or more of the supported ad formats.

Requirements

Step 1. Add the SDK

You can add the Vungle SDK using Swift Package Manager, CocoaPods, or manual integration.

Option 1. Swift Package Manager

To install the VungleAds Swift Package in Xcode:

  1. In Xcode, navigate to FileAdd Packages.
  2. In the prompt, search for the VungleAds Swift Package GitHub repository: https://github.com/Vungle/VungleAdsSDK-SwiftPackageManager.git.
  3. Select the version of the VungleAds Swift Package you want to use. For new projects, we recommend using the Up to Next Major Version.

At this point you can skip the manual integration instructions and continue to Add SKAdNetwork IDs to Info.plist.

Option 2. CocoaPods

The Vungle SDK is available through CocoaPods, which provides pod support for XCFramework files. Add the following into your project’s Podfile (if your project doesn’t have a Podfile, first run pod init to add the Podfile to your project directory):

pod "VungleAds"

After that, a quick pod install run will update your project with the latest version of our iOS SDK.

pod install --repo-update

At this point you can skip the manual integration instructions and continue to Add SKAdNetwork IDs to Info.plist.

NOTE: The CocoaPods trunk is moving to read-only at the end of 2026 as outlined in this blog post. If you currently use CocoaPods to integrate our SDK, we recommend that you update to use Swift Package Manager.

Option 3. Integrate Manually

  1. Download the latest version of the Vungle SDK for iOS and link VungleAdsSDK.xcframework in your project. For Swift projects, this is the only requirement.
  2. For Objective-C projects, create a bridging header in your project, if one does not already exist. To create a bridging header, create a new Swift file for your project, create the bridging header when prompted, and add the following import:

    import <VungleAdsSDK/VungleAdsSDK.h>

Continue to Add SKAdNetwork IDs to Info.plist below.

Add Ad Network IDs to Info.plist

Configure your app to participate in ad campaigns via Apple's attribution frameworks: SKAdNetwork (iOS 14+) and AdAttributionKit (iOS 17.4+).

Add the list of our approved partner IDs for advertising attribution to your Info.plist file. Adding the Vungle network ID along with the network 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.

To support both SKAdNetwork and AdAttributionKit, you must configure both SKAdNetworkItems and AdAttributionKit Identifiers in your Info.plist. Refer to Apple's documentation for details about configuring the Info.plist properly for ad campaigns to be served. Refer also to the XCode documentation for help on editing property lists.

Vungle hosts the Vungle ad network ID and the list of our buyers' ad network IDs in the XML format on our website. Note that our lists are updated periodically:

List of Ad Network IDs in XML

Note: Network ID suffixes are not framework-specific. While older network IDs typically end with .skadnetwork and newer ones with .adattributionkit, these suffixes are merely naming conventions and are compatible across both AdAttributionKit and SKAdNetwork. You don’t need a specific ad network ID for one or the other.

SKAdNetwork (iOS 14+)

To configure your app with ad network IDs for SKAdNetwork (iOS 14+):

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

AdAttributionKit (iOS 17.4+)

To configure your app with ad network IDs for AdAttributionKit (iOS 17.4+):

  1. Inside the Xcode Project navigator, open the Info.plist file.
  2. Click the add button (+) next to a key in the property list inside the Info.plist file.
  3. Enter AdAttributionKit - Ad Network Identifiers and select 'Array' in the Type column.
  4. Add a String item, then add the ad network ID as the value.

Privacy Manifest Support

VungleAds SDK 7.3.1+ integrates a Privacy Manifest file to comply with Apple's Privacy Manifest Framework

Required Reasoning APIs

Below are the required reasoning APIs that VungleAds SDK uses. 

Required Reasoning APIs API Type Reason
File Timestamp APIs  NSPrivacyAccessedAPICategoryFileTimestamp C617.1
Disk Space APIs NSPrivacyAccessedAPICategoryDiskSpace E174.1
User Defaults APIs NSPrivacyAccessedAPICategoryUserDefaults CA92.1
System Boot Time APIs NSPrivacyAccessedAPICategorySystemBootTime 35F9.1

Step 2. Initialize the SDK

After you have successfully installed the SDK, you must initialize it.

  1. Open your project file (or workspace if you are using CocoaPods).
  2. Add the following import in your App Delegate (or App file if using SwiftUI):

    SwiftObjective-C
    import VungleAdsSDK
  3. Add the following code snippet in your App Delegate (or App file if using SwiftUI):

    SwiftObjective-C
    VungleAds.initWithAppId("<YOUR_APP_ID>") { error in
        if let error = error {
            print("Error initializing SDK")
        } else {
            print("Init is complete")
        }
    }
    
    if (VungleAds.isInitialized()) {
        print("SDK is initialized")
    } else {
        print("SDK is NOT initialized")
    }

Step 3. Integrate app-ads.txt

Follow the instructions to integrate app-ads.txt in the Advanced Settings article.

Publishers who adopt app-ads.txt are likely to earn more revenue, as many brand buyers and advertisers require publishers to have a valid app-ads.txt file and will not buy inventory on apps without one.

Like ads.txt, app-ads.txt is a text file that app developers upload to their developer website listed on Google Play and the App Store. It lists the ad sources authorized to sell that developer’s in-app inventory. Just like on the web, the IAB created this standard to let buyers know who is and isn’t authorized to buy and sell specific in-app inventory. It is a key step that protects app developers from unauthorized reselling or inventory fraud.

Step 4. Integrate Ad Formats

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

Step 5. 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, integrating Alternative IDs to unlock premium brand demand, and more.

Questions?

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

Was this article helpful?