Skip to main content

iOS SDK Integration

Integrating the SDK​

You can install the SDK with CocoaPods or with Swift Package Manager. Use one of them for the SDK and its mediation adapters, not both: the two would each bring their own copy of Google Mobile Ads and AppLovin.

Current vs. legacy build. Every release ships in two flavors that are functionally identical and differ only in the bundled Google Mobile Ads (GAM) version:

  • Current (default, e.g. 9.9.0) — tracks the latest Google Mobile Ads SDK (13.x).
  • Legacy (e.g. 9.9.0-legacy) — stays on an older, stable Google Mobile Ads version (12.14.0). Use it if your project needs to stay on the older GAM — for example an older toolchain, or another dependency pinned to Google Mobile Ads 12.

With Swift Package Manager, current mediation adapter versions need Google Mobile Ads 13. If you use the legacy build and mediation adapters, install with CocoaPods.

Cocoapods​

CocoaPods installs the SDK from Empower's spec repository.

Step 1: Simply open your project's Podfile and add a new source to the top:

source 'https://github.com/empowernet/specs.git'

Step 2: Add the pod to your app's target block. use_frameworks! is required — the SDK ships as a Swift binary framework and the mediation adapters need it:

target 'YOUR_PROJECT_NAME' do
use_frameworks!
pod 'EmpowerMobileAds', '9.9.0' # use the latest released version — see the changelog
end

For the legacy build, pin the -legacy version:

pod 'EmpowerMobileAds', '9.9.0-legacy' # older, stable Google Mobile Ads (12.14.0)

Step 3: Run the following command from the command line to install the dependencies:

pod install --repo-update

If you're new to CocoaPods, please refer to their official documentation for more information on getting started with it.

Step 4: Add the $(inherited) line to the Other Linker Flags section in Build Settings, so the flags CocoaPods sets reach your app:

Target -> Build Settings -> Other Linker Flags

Swift Package Manager​

Swift Package Manager is available from SDK 9.8.12 and needs Xcode 15 or later.

Step 1: In Xcode, choose File → Add Package Dependencies… and enter the package URL:

https://github.com/empowernet/EmpowerMobileAds-SPM.git

Step 2: Choose the version:

  • Current build: set Dependency Rule to Up to Next Major Version and enter the latest version, e.g. 9.9.0.
  • Legacy build: set Dependency Rule to Exact Version and enter the -legacy version, e.g. 9.9.0-legacy. Legacy versions are prerelease tags, so a version range never selects them.

Step 3: Click Add Package, then add the EmpowerMobileAds library to your app target.

Step 4: Add -ObjC to Target -> Build Settings -> Other Linker Flags. Google Mobile Ads and the mediation adapters are loaded by class name at run time, and without this flag the linker leaves them out of your app. (With CocoaPods, $(inherited) brings in the same flag.)

If your project is itself a Swift package, add the dependency to its Package.swift instead:

dependencies: [
// Current build:
.package(url: "https://github.com/empowernet/EmpowerMobileAds-SPM.git", from: "9.9.0"),
// …or the legacy build:
// .package(url: "https://github.com/empowernet/EmpowerMobileAds-SPM.git", exact: "9.9.0-legacy"),
],
targets: [
.target(name: "YourApp", dependencies: [
.product(name: "EmpowerMobileAds", package: "EmpowerMobileAds-SPM")
])
]

The package brings in the same dependencies as the pod: Google Mobile Ads, Google IMA, the AppLovin SDK, Amazon Publisher Services and AppLovin's Amazon adapter. To update later, choose File → Packages → Update to Latest Package Versions.

Update your Info.plist​

Declare that your app is an AdManager app by adding a key named GADApplicationIdentifier with the string value which will be provided by us to your app's Info.plist file.

You may also make this change manually by adding the following lines to Info.plist:

<key>GADApplicationIdentifier</key>
<string>ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy</string>

Configure SKAdNetwork​

SKAdNetwork is how ad networks attribute installs on iOS without tracking the user. If your Info.plist doesn't list a network's SKAdNetwork ID, that network can't attribute conversions — which directly lowers your fill and revenue. This step is required for production.

Add an SKAdNetworkItems array to your Info.plist, with one SKAdNetworkIdentifier entry per network:

<key>SKAdNetworkItems</key>
<array>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>cstr6suwn9.skadnetwork</string>
</dict>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>4fzdc2evr5.skadnetwork</string>
</dict>
<!-- …all IDs from the AppLovin list -->
</array>

Copy every entry from the AppLovin SKAdNetwork ID list into this array. AppLovin keeps the list up to date and it covers all the demand networks Empower uses, including Google and the mediation adapters. A JSON version is also available. Check the list again before each release so that new IDs are not missed.

Importing the SDK​

In order to be able to use the Empower Mobile Ads SDK, you must import it where necessary.

Projects using Swift​

Please add the following line to the files where you refer to the classes provided by the Empower Mobile Ads SDK:

import EmpowerMobileAds

Projects using Objective-C​

The SDK exposes an Objective-C-compatible API, so you can call it directly from your .m and .h files. No bridging header is required — a bridging header only exposes your app's own Objective-C code to your app's Swift code, which is not what you need to consume the framework.

With CocoaPods, keep use_frameworks! in your Podfile. With Swift Package Manager there is nothing extra to set up. Then import the SDK module in every file that uses it:

@import EmpowerMobileAds;

Before SDK 9.8.12 the framework did not define a module for Objective-C, so @import fails on older versions. Import the generated header there instead: #import <EmpowerMobileAds/EmpowerMobileAds-Swift.h>.

Objective-C uses the same EMAManager / EMASettings entry points as Swift. The only differences are the delegate and status types: adopt EMAAdObserver (instead of AdStatusDelegate) and switch on EMAAdStatusType (instead of AdStatus). Each ad-format page below shows both Swift and Objective-C examples.

Integrating Mediation Networks​

Already included — don't add these yourself: installing EmpowerMobileAds automatically brings in Google Mobile Ads, the AppLovin SDK, Google IMA (for preroll) and Amazon Publisher Services with AppLovin's Amazon adapter. Adding those pods or packages (or a different version of them) separately causes version conflicts. The adapters below are only for additional demand networks — add just the ones Empower has enabled for your account. An adapter for a network that isn't configured server-side has no effect.

Install the adapters with the same tool you installed the SDK with.

With CocoaPods​

Add the adapter pods Empower has enabled for your account, then run pod install --repo-update:

use_frameworks!
inhibit_all_warnings!

target 'YOUR_PROJECT_NAME' do
# AppLovin MAX adapters
pod 'AppLovinMediationGoogleAdManagerAdapter' # Google Ad Manager
pod 'AppLovinMediationGoogleAdapter' # Google / AdMob bidding
pod 'AppLovinMediationByteDanceAdapter' # Pangle
pod 'AppLovinMediationFacebookAdapter' # Meta Audience Network
pod 'AppLovinMediationFyberAdapter' # DT Exchange (Fyber)
pod 'AppLovinMediationInMobiAdapter' # InMobi
pod 'AppLovinMediationMintegralAdapter' # Mintegral
pod 'AppLovinMediationOguryPresageAdapter' # Ogury
pod 'AppLovinMediationUnityAdsAdapter' # Unity Ads
pod 'AppLovinMediationVungleAdapter' # Liftoff Monetize (Vungle)
pod 'AppLovinMediationYandexAdapter' # Yandex

# Google Mobile Ads (GAM) mediation adapters
pod 'GoogleMobileAdsMediationFacebook' # Meta Audience Network
pod 'GoogleMobileAdsMediationFyber' # DT Exchange (Fyber)
pod 'GoogleMobileAdsMediationInMobi' # InMobi
pod 'GoogleMobileAdsMediationMintegral' # Mintegral
pod 'GoogleMobileAdsMediationPangle' # Pangle
pod 'GoogleMobileAdsMediationUnity' # Unity Ads
pod 'GoogleMobileAdsMediationVungle' # Liftoff Monetize (Vungle)
end

With Swift Package Manager​

Each adapter is a package of its own. For every adapter Empower has enabled for your account:

  1. Choose File → Add Package Dependencies… and enter the package URL from the tables below, with .git at the end (for example https://github.com/AppLovin/AppLovin-MAX-Swift-Package-Google.git). Xcode treats the field as a search, so without it you may get another package whose name starts the same way (see troubleshooting).
  2. Set Dependency Rule to Exact Version and enter the version (see choosing adapter versions). Don't use Up to Next Major Version for these packages: AppLovin writes each adapter version as its own major number, and with a version range Xcode can pick an adapter that conflicts with another one.
  3. Add the library from the table to your app target, and check that its name is the one in the table: it is how you tell which package you added.

Make sure -ObjC is in your app's Other Linker Flags (Step 4). AppLovin and Google Mobile Ads find adapters by class name, so without the flag the linker leaves every adapter out of the app: it builds and runs, but those networks never serve an ad.

AppLovin MAX adapters

NetworkPackage URLLibraryTested version
Google Ad Managerhttps://github.com/AppLovin/AppLovin-MAX-Swift-Package-GoogleAdsManagerAppLovinMediationGoogleAdManagerAdapter13130000.0.0
Google / AdMob biddinghttps://github.com/AppLovin/AppLovin-MAX-Swift-Package-GoogleAppLovinMediationGoogleAdapter13130000.0.0
Panglehttps://github.com/AppLovin/AppLovin-MAX-Swift-Package-PangleAppLovinMediationByteDanceAdapter804000800.0.0
Meta Audience Networkhttps://github.com/AppLovin/AppLovin-MAX-Swift-Package-MetaAppLovinMediationFacebookAdapter6220100.0.0
DT Exchange (Fyber)https://github.com/AppLovin/AppLovin-MAX-Swift-Package-FyberAppLovinMediationFyberAdapter8050200.0.0
InMobihttps://github.com/AppLovin/AppLovin-MAX-Swift-Package-InMobiAppLovinMediationInMobiAdapter11050000.0.0
Mintegralhttps://github.com/AppLovin/AppLovin-MAX-Swift-Package-MintegralAppLovinMediationMintegralAdapter801090000.0.0
Oguryhttps://github.com/AppLovin/AppLovin-MAX-Swift-Package-OguryAppLovinMediationOguryPresageAdapter5040000.0.0
Unity Adshttps://github.com/AppLovin/AppLovin-MAX-Swift-Package-UnityAdsAppLovinMediationUnityAdsAdapter4220000.0.0
Liftoff Monetize (Vungle)https://github.com/AppLovin/AppLovin-MAX-Swift-Package-LiftoffAppLovinMediationVungleAdapter7080000.0.0
Yandexhttps://github.com/AppLovin/AppLovin-MAX-Swift-Package-YandexAppLovinMediationYandexAdapter8070100.0.0

Google Mobile Ads (GAM) mediation adapters

NetworkPackage URLLibraryTested version
Meta Audience Networkhttps://github.com/googleads/googleads-mobile-ios-mediation-metaMetaAdapterTarget6.22.100
DT Exchange (Fyber)https://github.com/googleads/googleads-mobile-ios-mediation-dtexchangeDTExchangeAdapterTarget8.5.200
InMobihttps://github.com/googleads/googleads-mobile-ios-mediation-inmobiInMobiAdapterTarget11.5.000
Mintegralhttps://github.com/googleads/googleads-mobile-ios-mediation-mintegralMintegralAdapterTarget8.1.900
Panglehttps://github.com/googleads/googleads-mobile-ios-mediation-panglePangleAdapterTarget8.4.00800
Unity Adshttps://github.com/googleads/googleads-mobile-ios-mediation-unityUnityAdapterTarget4.22.000
Liftoff Monetize (Vungle)https://github.com/googleads/googleads-mobile-ios-mediation-liftoffmonetizeLiftoffMonetizeAdapterTarget7.8.000

The tested versions were installed together, all of them at once, with EmpowerMobileAds 9.8.12 (current build), and every adapter was found at run time.

Choosing adapter versions​

Each adapter pins exact versions of what it depends on, so the versions you pick have to agree with each other. Xcode reports a dependency conflict when they don't.

  • AppLovin adapter versions are one long number. 13130000.0.0 is adapter 13.13.0.0, 804000800.0.0 is 8.4.0.8.0.
  • AppLovin's Google and Google Ad Manager adapters pin one exact Google Mobile Ads version. 13130000.0.0 needs Google Mobile Ads 13.13.0. Pick the version that matches the Google Mobile Ads version Xcode resolved for EmpowerMobileAds (listed under Package Dependencies in the project navigator).
  • A network with both an AppLovin and a Google adapter needs both to pin the same network SDK. Each adapter pins its network's SDK exactly, so the two must agree. For example, Pangle's newest AppLovin adapter (804000900.0.0) needs Pangle SDK 8.4.0-release.9, while the newest Google adapter (8.4.00800) needs 8.4.0-release.8. Use AppLovin 804000800.0.0 with it, which also needs release.8. The package's Package.swift on GitHub shows the SDK version each adapter version pins.
  • Legacy build: current versions of the Google adapters, and of AppLovin's Google and Google Ad Manager adapters, need Google Mobile Ads 13, while the legacy build stays on 12.14.0. With Swift Package Manager you would be held to old adapter versions, so if you need the legacy build with mediation adapters, install with CocoaPods.

Don't add AppLovin's AppLovin-MAX-Swift-Package-AmazonAdMarketplace package: EmpowerMobileAds already brings in Amazon Publisher Services and AppLovin's Amazon adapter, and the two would clash.

Troubleshooting​

"Failed to resolve dependencies" for the two Pangle adapters

Xcode stops resolving packages with an error like this:

Failed to resolve dependencies Dependencies could not be resolved because root depends on
'applovin-max-swift-package-pangle' 804000900.0.0..<804000901.0.0 and root depends on
'googleads-mobile-ios-mediation-pangle' 8.4.800..<9.0.0.
... 'applovin-max-swift-package-pangle' 804000900.0.0 depends on 'adsglobalpackage' 8.4.0-release.9 ...
... 'googleads-mobile-ios-mediation-pangle' 8.4.800 depends on 'adsglobalpackage' 8.4.0-release.8.

Each Pangle adapter pins an exact Pangle SDK (adsglobalpackage), and these two pin different ones: AppLovin's 804000900.0.0 needs 8.4.0-release.9, while Google's newest adapter, 8.4.800, needs 8.4.0-release.8. Use the AppLovin version that pins the same SDK as Google's:

  1. Select your project in the project navigator, then open the Package Dependencies tab.
  2. Double-click AppLovin-MAX-Swift-Package-Pangle.
  3. Set Dependency Rule to Exact Version and enter 804000800.0.0.
  4. Choose File → Packages → Resolve Package Versions.

Both adapters then share Pangle SDK 8.4.0-release.8. Move both to release.9 once Google publishes a Pangle adapter for it. The same kind of error for another network has the same cause and the same fix: pick the two versions that pin the same network SDK.

Adding AppLovin-MAX-Swift-Package-Google shows "Google Ad Manager Mediation Adapter"

Xcode searches with what you type, and …-Package-Google is also the start of …-Package-GoogleAdsManager, so it can show or preselect AppLovin's Google Ad Manager adapter instead, especially when that one is already in the project. The two are different adapters, and video native fills through MAX come through the Google one.

  • Enter the URL with .git at the end: https://github.com/AppLovin/AppLovin-MAX-Swift-Package-Google.git.
  • If Xcode lists several packages, pick "AppLovin MAX - iOS Google Mediation Adapter", the one without "Ad Manager" in its name.
  • On the last step, the library must be AppLovinMediationGoogleAdapter. If it says AppLovinMediationGoogleAdManagerAdapter, you added the Ad Manager package again.