Installation of the iOS SDK

1. Installation

Requirements

To integrate the latest Tapdaq SDK please make sure Deployment Target is 8.0 or above and you are using Xcode 8.0 or above.

The following networks have higher minimum requirements:

Network Minimum Requirements
AdMob Xcode 9.2
Applovin Deployment Target: 9.0
Facebook AN Deployment Target: 9.0
HyprMX Deployment Target: 10.0
InMobi Xcode 9.3, Deployment Target: 9.3
MoPub Xcode 9.0
Tapjoy Xcode 9.3
Vungle Xcode 9.0
YouAppi Xcode 10.2(exact version), Deployment Target: 9.0

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.

Add Tapdaq & ad network adapters


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.

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:

Objective-C
Swift
#import <Tapdaq/Tapdaq.h>

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
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    TDProperties *properties = [[TDProperties alloc] init];
    properties.userSubjectToGDPR = TDSubjectToGDPRYes; //GDPR declare if user is in EU
    properties.isConsentGiven = YES; //GDPR consent must be obtained from the user
    properties.isAgeRestrictedUser = YES; //Is user under 16 (Used by AppLovin & YouAppi)

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

    return YES;
}

You can find your App ID and Client Key by logging into the Tapdaq Dashboard, and then visiting Settings > General tab.

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

On Tapdaq SDK v7.2.0 and above

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.

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.

You must also support all orientations:

"AdColony SDK requires your app support all orientations globally. This requirement is in place because AdColony ads may be shown in any orientation, and our view controller needs your app to support that behavior. Please note that this requirement does not dictate that your app's interface support all orientations; you just have to override the global settings in your view controllers' supportedInterfaceOrientations method."

E. InMobi specific steps

In your project's build settings you need to add -ObjC to other linker flags.

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.