Get Started

Release version: 2.10.1 | Release date: 24.05.2021

Minimum requirements:

  • iOS 10.0 or higher. You still can integrate the Appodeal SDK into a project with a lower value of minimum iOS version. On the devices that don’t support iOS 10.0+ our SDK will just be disabled.
  • The Appodeal SDK is compatible with both ARC and non-ARC projects.
  • Use Xcode 12.5 or higher.

You can use our demo app as a reference project.

Step 1. Import SDK

Fat and CocoaPods 2.10.1 versions work in pure Obj-C, in pure Swift,  in mixed Obj-C, Swift projects.

If your project is pure Objective-C project, you should add empty Swift file. For example Dummy.swift.

1. Podfile configuration

CocoaPods 1.10.0 or higher is required. To get information about CocoaPods update please see this documentation.

Please select ad types that are used in your application and ad networks that you want to include. Than press Generate Podfile button and copy configuration in your project's Podfile.


2. Call pod install

Call $ pod install to install CocoaPods dependencies or $ pod update to update. If you do not have an installed pod, Install CocoaPods to simplify dependency management

sudo gem install cocoapods
If you have problems with versions of pods, please run the following code:
rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod update
If the official repo doesn't respond, you can add aline to your podspec and update pods from the Appodeal mirror  repository:
source 'https://github.com/appodeal/CocoaPods.git'
source 'https://cdn.cocoapods.org/'

 
 

Step 2. Prepare your application

2.1 Add SKAdNetworkIds

Ad networks used in Appodeal mediation support conversion tracking using Apple's SKAdNetwork , which means ad networks are able to attribute an app install even when IDFA is unavailable. To enable this functionality, you will need to update the SKAdNetworkItems key with an additional dictionary in your  Info.plist .

  1. Select Info.plist in the Project navigator in Xcode
  2. Click the Add button (+) beside a key in the property list editor and press Return
  3. Type the key name SKAdNetworkItems
  4. Choose an Array  type
  5. Add Key-Value pair where the key is SKAdNetworkIdentifier and the value is the ad network identifier

There is SKAdNetworks IDs in  Info.plist format:


2.2 Configure App Transport Security Settings

In order to serve ads, the SDK requires you to allow arbitrary loads. Set up the following keys in info.plist of your app:

  1. Go to your info.plist  file, then press  Add+ anywhere in the first column of the key list.
  2. Add App Transport Security Settings key  and set its type to  Dictionary in the second column.
  3. Press Add+  at the end of the name  App Transport Security Settings key  and choose  Allow Arbitrary loads . Set its type to  Boolean  and its value to  Yes .

You can also add the key to your info.plist directly, using this code:

<key>NSAppTransportSecurity</key>
<dict>
  <key>NSAllowsArbitraryLoads</key>
  <true/>
</dict>

2.3 Other feature usage descriptions

To improve ad performance the the following entries should be added:

  1. GADApplicationIdentifier - When including AdMob in your project you must also add your AdMob app ID to your info.plist . Use the key GADApplicationIdentifier with the value being your AdMob app ID.
  2. NSUserTrackingUsageDescription - As of iOS 14 using IDFA requires permission from the user. The following entry must be added in order to improve ad performance.
  3. NSLocationWhenInUseUsageDescription - Entry is required if your application allows Appodeal SDK to use location data.
  4. NSCalendarsUsageDescription - Recommended by some ad networks.

<key>GADApplicationIdentifier</key> 
<string>YOUR_ADMOB_APP_ID</string>
<key>NSUserTrackingUsageDescription</key>
<string><App Name> needs your advertising identifier to provide personalised advertising experience tailored to you</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string><App Name> needs your location for analytics and advertising purposes</string>
<key>NSCalendarsUsageDescription</key>
<string><App Name> needs your calendar to provide personalised advertising experience tailored to you</string>

Step 3. Initialize SDK

Before initialisation we highly recommend to receive all required permissions from user, please follow this data protection guide .

Import Appodeal into AppDelegate (AppDelegate.m) class and initialise the SDK: 

import Appodeal
We recommended to call initialisation method in AppDelegate - didFinishLaunchingWithOptions  function:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
   Appodeal.initialize(withApiKey: "YOUR_API_KEY", types: adTypes, hasConsent: consent)
   return true
}
The adTypes   parameter is responsible for ad formats (ex.  AppodealAdTypeRewardedVideo, AppodealAdTypeInterstitial ).

Step 4. Configure ad types

Appodeal SDK is now imported and you're ready to implement an ad. Appodeal offers a number of different ad formats, so you can choose the one that best fits your app's user experience.

Full-screen ad that engages users with a captivating video.


User-initiated ads where users can earn in-app rewards in exchange for viewing a video ad.


Traditional ad format that neatly places a small ad at the top or bottom of the screen.


Medium-size ads that appear within in-app content the same as banner ads.


Ad format that seamlessly fits within the context of an app’s content.

Step 5. Publish your application

Update App Store IDFA usage. When you submit your application to the App you need to update its "Advertising Identifier (IDFA)" settings in order to comply with Apple advertising policy.

  1. Go to the Advertising Identifier section.
  2. Set Yes on the right panel.
  3. Tick Serve advertisements within the app .
  4. Tick confirmation box under Limit Ad tracking setting in iOS .

Configure App Privacy according to this doc: 

Known issues

1. AdColony presentation issue

AdColony always checks, if the key window’s rootViewController matches the passed rootViewController. Otherwise, Adcolony fails to present the ad. If your app has multiple independent windows, you can get a message with this or similar text:

AdColony [*** ERROR ***] : AdColony has ads, but could not display them. AdColony was unable to find the currently visible UIViewController for your app. Please ensure that your key UIWindow has a rootViewController.

It means, that the rootViewController that was used in showAd, doesn't belong to the first window in the array. 

2. AVAudioSession issue

If you use video or audio sessions in your app (usually for music players), you may encounter a problem with incorrect audio playback when loading an AdMob ad.
To solve this problem, add the following method to Your AppDelegate:

import GoogleMobileAds

final class AppDelegate ... {
    func application(
        _ application: UIApplication, 
        didFinishLaunchingWithOptions launchOptions:[UIApplication.LaunchOptionsKey: Any]?
    ) -> Bool {
        GADMobileAds.sharedInstance().audioVideoManager.audioSessionIsApplicationManaged = true
        return true
    }
}         
      

More info you can find here: https://developers.google.com/admob/ios/global-settings#changing_audio_session

3. MyTarget auto-initialisation issue

MyTarget supports auto-initialisation that may cause a crash at application loading. To disable this behaviour add following key value pair into info.plist:

<key>MyTargetSDKAutoInitMode</key> 
    <false/>
</key>