Installation of the iOS SDK

Please download our latest SDK.

1. Installation

Please make sure Deployment Target is 8.0 or above and you are using Xcode 8.0 or above.

Cocoapods (recommended)

CocoaPods is a dependency manager for Objective-C and Swift. We highly recommend using CocoaPods to keep the Tapdaq SDK up-to-date.

A. Add Tapdaq SDK

To integrate Tapdaq with Cocoapods, update your Podfile to look like this:

platform :ios, '9.0'
source 'https://github.com/CocoaPods/Specs.git'

# This line is required to be able to install Tapdaq SDK and network adapters
source 'https://github.com/tapdaq/cocoapods-specs.git'

use_frameworks!

target 'MyApp' do
    pod 'Tapdaq'
end

Be sure to replace 'MyApp' with the name of your target in Xcode.

Alos, make sure Tapdaq podspec repo URL is specified in your Podfile. In can be done by adding this line:

source 'https://github.com/tapdaq/cocoapods-specs.git'

Run pod install from your terminal, this will install the Tapdaq SDK into your project.

If you want to update the Tapdaq SDK, simply run pod update.

B. Add ad network adapters

To integrate an ad network adapter into your project, update your Podfile to look like this:

platform :ios, '9.0'
source 'https://github.com/CocoaPods/Specs.git'

# This line is required to be able to install Tapdaq SDK and network adapters
source 'https://github.com/tapdaq/cocoapods-specs.git'

# This line is required to be able to install Receptiv SDK using CocoaPods
source 'https://github.com/mediabrix/mediabrix-cocoapods-spec.git'

use_frameworks!

target 'MyApp' do
    pod 'Tapdaq'
    pod 'Tapdaq/AdColony'
    pod 'Tapdaq/AdMob'
    pod 'Tapdaq/AppLovin'
    pod 'Tapdaq/Chartboost'
    pod 'Tapdaq/FAN'
    pod 'Tapdaq/HyprMx'
    pod 'Tapdaq/InMobi'
    pod 'Tapdaq/IronSource'
    pod 'Tapdaq/Kiip'
    pod 'Tapdaq/MoPub'
    pod 'Tapdaq/Receptiv'
    pod 'Tapdaq/Tapjoy'
    pod 'Tapdaq/UnityAds'
    pod 'Tapdaq/Vungle'
    pod 'Tapdaq/YouAppi'
    pod 'Tapdaq/ZPlay'
end

Each adapter is optional, you choose which networks you wish to integrate.

Once this is done, run pod install to install the new adapter(s), or if you wish to update one or more adapters, run pod update.

You have now installed the Tapdaq SDK and ad network adapters, you are ready to proceed with authenticating with Tapdaq.

Note: If you wish to include Receptiv make sure the following line is included in your Podfile. Receptiv has their own podspec repository.

source 'https://github.com/mediabrix/mediabrix-cocoapods-spec.git'

Manual Installation

If you would like to install the Tapdaq SDK without using Cocoapods, please follow the steps below.

A. Add dependencies

Open your project in Xcode, click on the project file, and select the target of the application, then click Build Phases.

Please add the following frameworks under the Link Binary With Libraries section or paste the following to the top of your AppDelegate.h/AppDelegate.swift) file:

Objective-C
Swift
@import AVFoundation;
@import AdSupport;
@import AudioToolbox;
@import CFNetwork;
@import CoreBluetooth;
@import CoreData;
@import CoreGraphics;
@import CoreImage;
@import CoreLocation;
@import CoreMedia;
@import CoreMotion;
@import CoreTelephony;
@import CoreVideo;
@import EventKit;
@import EventKitUI;
@import Foundation;
@import GLKit;
@import ImageIO;
@import JavaScriptCore;
@import MapKit;
@import MediaPlayer;
@import MediaToolbox;
@import MessageUI;
@import MobileCoreServices;
@import QuartzCore;
@import SafariServices;
@import Security;
@import Social;
@import StoreKit;
@import SystemConfiguration;
@import UIKit;
@import WatchConnectivity;
@import WebKit;

The following needs to be added manually by drag and drop in the to the Link Binary With Libraries section of your project:

  • libz.tbd
  • libz.1.2.5.tbd
  • libc++.tbd
  • libsqlite3.0.tbd
  • libxml2.tbd

B. Add the Tapdaq framework

Drag the unzipped Tapdaq.framework into your project (under the Frameworks group). We recommend that you tick Copy items into destination group's folder. Next, add Tapdaq.framework to the Link Binary With Libraries section of your project.

Swift bridging header

If you are using Swift in your project, you need to create a bridging header if you haven't done so already.

To do this, create a Header File (File > New > File...) and name it with the following format; YourProject-Bridging-Header.h replace YourProject with your project name. Save the file in your project directory.

Once created, add the following:

#import <Tapdaq/Tapdaq.h>

Next, go to your Build Settings and search for Objective-C Bridging Header property.

Once you have found it, add this as the value: $(PROJECT_DIR)/YourProject-Bridging-Header.h.

Remember to replace YourProject with your project name.

Build Settings

Build Settings Navigate to the Build Settings of the app's target. Select the All tab. Search for the following entries and make sure all of them are set to or contain these values:

Key Value
Objective-C Automatic Reference Counting YES
Enable Modules (C and Objective-C) YES
Other Linker Flags -ObjC

C. Add ad network dependencies

Depending on the ad networks required, their SDKs should be added to the project.

These SDKs can be found within a folder with network's respective name in Network-SDKs directory.

All .a and .framework files should be added to Link Binary With Libraries within General section of your project settings.

If you wish to use one of the following networks, please add frameworks listed below to Embedded Binaries within General section of your project settings.

Network Framework(s)
Kiip XIDLibrary.framework
YouAppi YouAppiMoat.framework

D. Add ad network adapters

In order for Tapdaq SDK to be able to access network SDKs, respective adapter has to be added to the project.

Tapdaq SDK will automatically detect if the ad network adapters are included in your project.

To add them, use the adapters provided in the zip, they will be located in the adapters folder. Drag and drop them to the Link Binary With Libraries section under the General tab.

E. Add ad network resources

Some networks may require their resources to be added to the app.

If you wish to use one of the following adapters, please navigate to Network-SDKs and then to a folder named after the network you require, inside there is one or more .bundle file.

Network Bundle(s)
Tapjoy TapjoyResources.bundle
MoPub MoPub.bundle
Kiip KiipSDKResources.bundle
Zplay ZplayMuteListener.bundle

Please add these bundles to your Copy Bundle Resources section under Build Phases.

2. Authenticate with Tapdaq

Once you have added the framework, next you need to add the following #import statement at the top of your AppDelegate.m file:

#import <Tapdaq/Tapdaq.h>

Note: Above step is not required for Swift.

Navigate to the following method in your AppDelegate.m file and add the following command:

You have no inactive iOS apps on your account. You can add a new app here.

Objective-C
Swift
// Objective-C
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    TDProperties *tapdaqProps = [[TDProperties alloc] init];
    tapdaqProps.userSubjectToGDPR = TDSubjectToGDPRYes; //GDPR declare if user is in EU
    tapdaqProps.isConsentGiven = YES; //GDPR consent must be obtained from the user
    tapdaqProps.isAgeRestrictedUser = YES; //Is user under 16 (Used by AppLovin & YouAppi)

    [[Tapdaq sharedSession] setApplicationId:@"<APP_ID>"
                                   clientKey:@"<CLIENT_KEY>"
                                  properties:tapdaqProps];

    return YES;
}

3. Update GDPR Consent

Consent can be updated mid session as well as at initialisation, it can be set and unset.

Objective-C
Swift
[Tapdaq sharedSession].userSubjectToGDPR = TDSubjectToGDPRYes;
[Tapdaq sharedSession].isConsentGiven = YES;
[Tapdaq sharedSession].isAgeRestrictedUser = YES;

4. Display an advert

To display an advert, please click on one of the following guides.

You can test that each ad network has been integrated correctly by visiting the Debugging page.

5. Submitting to Apple

Please add the following entries in Target -> Info -> Custom iOS Target Properties. These steps are required when submitting your app to the App Store.

A. App Transport Security

App Transport Security (ATS), introduced in iOS 9, improves user security and privacy by requiring apps to use secure network connections over HTTPS. However, some ad network adapters still use insecure network connections in their ad serving. As such, please follow the steps below to ensure your app passes Apple’s review process:

App Transport Security Settings: Set the type to Dictionary and add the "Allow Arbitrary Loads" key as a Boolean type and set the value to 'YES'

B. Calendars Usage Description

When including AdColony, HyprMX or Receptiv to your project, you must set the following entry in order to submit your app to Apple:

NSCalendarsUsageDescription: Set the type to String and set the value to the following Some ad content may create a calendar event.

C. AdMob specific steps

When including AdMob to your project, you must set the following additional App Transport Security settings:

NSAllowsArbitraryLoadsForMedia: Set the type to Boolean and set the value to YES

NSAllowsArbitraryLoadsInWebContent: Set the type to Boolean and set the value to YES

D. AdColony specific steps

When including AdColony to your project, you must set the following three entries in order to submit your app to Apple:

NSCalendarsUsageDescription: Set the type to String and set the value to the following Some ad content may create a calendar event.

NSPhotoLibraryUsageDescription: Set the type to String and set the value to the following Some ad content may require access to the photo library.

NSCameraUsageDescription: Set the type to String and set the value to the following Some ad content may access camera to take picture.

NSMotionUsageDescription: Set the type to String and set the value to the following Some ad content may require access to accelerometer for interactive ad experience.

E. YouAppi specific steps

When including YouAppi to your project, you must add YouAppiMoat.framework section. Also, you should add YouAppiAdapter.framework to Project Settings -> General -> Link Binary With Libraries.

Navigate to the Build Settings of the app's target. Select the All tab. Search for the following entries and make sure all of them are set to YES:

Key Value
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES YES
DEFINES_MODULE YES

Need help?

If you are having any problems integrating, feel free to contact us on [email protected] and we will be more than happy to help.