iOS SDK Integration

Before You Start

We support iOS version 9+. In case you use Xcode version lower than 9.3, we suggest archiving with 'bitcode' disabled.


This Guideline introduces the integration of AdTiming’s SDK in iOS Apps.

AdTiming offers diversified and competent monetization services and supports a variety of Ad formats including Native Ad, Interstitial Ad, Banner Ad, and Incentive Video Ad. The AdTiming platform mediates AdTiming, AdMob, Facebook, UnityAds, Vungle, Tapjoy, AppLovin, AdColony,  Chartboost, TikTok, Mintegral, GDT and IronSource.


Step 1. Add the SDK to Your Project

Importants!Since iOS SDK Version 4.0.0 and Above, the adapter for each ad network is modularized, which means that you need to download and add Not Only the SDK of mediation networks  you choose to work with But Also the adapters for those ad networks. For example, if you want to integrate AdMob and Applovin through AdTiming Mediation, you need to add the AdMob Adapter, AdMob SDK and Applovin Adapter, AppLovin SDK to the libs of your project. See the Add Mediation Networks for more infomation.

AdTiming supports both CocoaPods and manual download for SDK integration:


CocoaPods is a dependency manager for Objective-C and Swift; it automates and simplifies the SDK integration process. See the CocoaPods Guide on Getting Started and Using CocoaPods for more information.

To integrate our SDK with CocoaPods, enter the following line in your podfile:

pod 'AdTimingSDK','4.4.1'


Manual Download SDK Latest release

Download iOS SDK Version 4.4.1


AdTiming Mediation Demo App

The Integration Demo application demonstrate how to integrate the AdTiming Mediation in your app.

Download iOS Demo Application


Step 2. Build Settings

1. Add Linker Flags

  • Add the following linker flag to the build settings at:
    Target ➣ Build Settings ➣ Linking ➣ Other Linker Flags:

2. App Transport Security Settings

  • Add in a Dictionary called 'App Transport Security Settings'. Make sure you add this dictionary on the 'Top Level Key'.

  • Inside this dictionary, add a Boolean called 'Allow Arbitrary Loads' and send it to YES.


3. SKAdNetworkItems(For iOS 14)

  • Add in a Array called 'SKAdNetworkItems'. Make sure you add this dictionary on the 'Top Level Key'.

  • Add a Dictionary to the Array , add a String called 'SKAdNetworkIdentifier' and set value to '488r3q3dtq.skadnetwork'.


4. App Tracking Transparency(For iOS 14)

  • To display the App Tracking Transparency authorization request for accessing the IDFA, update your Info.plist to add the NSUserTrackingUsageDescription key with a custom message describing your usage.


  • To present the authorization request, call requestTrackingAuthorizationWithCompletionHandler:. We recommend waiting for the completion callback prior to loading ads, so that if the user grants the App Tracking Transparency permission, the AdTiming SDK can use the IDFA in ad requests.

#import <AppTrackingTransparency/AppTrackingTransparency.h>
#import <AdSupport/AdSupport.h>
- (void)requestUserIDFA { [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) { // Tracking authorization completed. Start loading ads here.
// [self loadAd];
import AppTrackingTransparency
import AdSupport
func resquestUserIDFA() { ATTrackingManager.requestTrackingAuthorization(completionHandler: {status in // Tracking authorization completed. Start loading ads here.
// loadAd()


Step 3. Initialize the AdTiming SDK

#import <ADTimingSDK/ADTimingSDK.h>
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
    [AdTiming initWithAppKey:@"YOUR_ADTIMING_APP_KEY"];
import AdTimingSDK
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions:[UIApplication.LaunchOptionsKey: Any]?) -> Bool {    


Initialize the AdTiming SDK with AdUnits

You can specify one or more ad types for initialization SDK, and we recommend this approach as it will only fetch the specific ad units you define in the adUnits parameter. The adUnits parameter is a string array. If you are using a method that does not have an ADType parameter(Step3), the SDK preloads the Interstitial and RewardedVideo.

1. Preload multiple ad types

[AdTiming initWithAppKey:@"YOUR_ADTIMING_APP_KEY" adType:(AdTimingAdTypeInterstitial|AdTimingAdTypeRewardedVideo)];
AdTiming.initWithAppKey("YOUR_ADTIMING_APP_KEY", adType:AdTimingAdType(rawValue: AdTimingAdType.interstitial.rawValue | AdTimingAdType.rewardedVideo.rawValue)!)

2. Preload one ad type

[AdTiming initWithAppKey:@"YOUR_ADTIMING_APP_KEY" adType:AdTimingAdTypeInterstitial;
AdTiming.initWithAppKey("YOUR_ADTIMING_APP_KEY", adType:AdTimingAdType.interstitial)


Send attribution data to AdTiming (optional)

If your project also integrates the AppsFlyer SDK, we need you to pass the application attribution data to AdTiming so that we can help you accurately calculate each Media Source, Campaign level ROAS, and LTV data.

1. When you receive the onConversionDataSuccess callback you can use the sendAFConversionData method for passing the attribution data dictionary:

For apps using AppsFlyer SDK version 5 and above 

- (void)onConversionDataSuccess:(NSDictionary *)conversionInfo {    
  /// Send AppsFlyer conversion data    
  [AdTiming sendAFConversionData:conversionInfo];
func onConversionDataSuccess(_conversionInfo: NSDictionary) {    
   /// Send AppsFlyer conversion data    


For apps using AppsFlyer SDK version 4 and below

- (void)onConversionDataReceived:(NSDictionary *)installData {    
  /// Send AppsFlyer conversion data    
  [AdTiming sendAFConversionData:installData];
func onConversionDataSuccess(_installData: NSDictionary) {    
   /// Send AppsFlyer conversion data    


2. When you receive the onAppOpenAttribution callback you can use the sendAFDeepLinkData method for passing the attribution data dictionary:

- (void)onAppOpenAttribution:(NSDictionary *)attributionData {    
  /// Send AppFlyer deep link attribution data    
  [AdTiming sendAFDeepLinkData:attributionData];
func onConversionDataSuccess(_attributionDate: NSDictionary) {    
   /// Send AppsFlyer conversion data    


Step 4. Use the Test Suite to test the integration

1. Install

The aggregation function test suite needs to be installed using Cocoapods. Please add the following code to your Podfile:

pod 'AdTimingTestSuite', '1.0.1'


2. Start the aggregation function test suite

#import <ADTimingTestSuite/ADTimingTestSuite.h>
[AdTimingTestSuite presentWithAppKey:@"YOUR_ADTIMING_APP_KEY" onViewController:YOUR_CONTROLLER];
import AdTimingTestSuite
AdTimingTestSuite.present(withAppKey:"YOUR_ADTIMING_APP_KEY", on:YOUR_CONTROLLER)

You can get more help through the Test Suite Tool chapter.


What’s Next?

1. Integrate our Rewarded Video, Interstitial, Banner and Native Ads in your app.
2. Follow 
our Add Mediation Networks and Mediation Network Guides to mediation networks.
After completing the above integration work, you can use AdTiming Test Suite tool to check whether the SDK aggregation integration is corrects.

Was this article helpful?
2 out of 2 found this helpful



Article is closed for comments.