Installation of the Unity SDK

We recommend the latest Unity Editor, this plugin supports 5.4.0 and above.

For iOS to integrate the latest Tapdaq SDK please make sure Deployment Target is 8.0 and Xcode 11.0 or above is used. In order to build an app using older Xcode versions bitcode must be disabled.

For Android the minimum version support is API level 14.

The following networks have higher minimum requirements:

Network Android API Level Xcode iOS Deployment Target
AdColony 14 Xcode 11.0 Deployment Target: 8.0
AdMob 14 Xcode 10.0 Deployment Target: 8.0
AppLovin 16 Xcode 8.0 Deployment Target: 9.0
Chartboost 15 Xcode 8.0 Deployment Target: 8.0
Facebook AN 14 Xcode 8.0 Deployment Target: 9.0
InMobi 15 Xcode 11.0 Deployment Target: 9.0
Maio 16 Xcode 8.0 Deployment Target: 8.0
Tapjoy 14 Xcode 9.3 Deployment Target: 8.0
TikTok N/A Xcode 10.0 Deployment Target: 8.0
UnityAds 14 Xcode 8.0 Deployment Target: 9.0
Vungle 14 Xcode 11.0 Deployment Target: 8.0
YouAppi 16 Xcode 10.2 Deployment Target: 9.0

1. Installation

Download the Plugin, and import the Tapdaq-UnityPlugin.unitypackage into your project. To do this, select Assets > Import Package > Custom Package..

2. App Settings

A. Credentials

To add in your iOS and Android App ID and Client Key, simply go to Window > Tapdaq > Edit Settings.

Window>Tapdaq>Edit Settings

A panel will appear in your editor prompting you to enter your Tapdaq App ID and Client Key (these can be found when logging in to the Tapdaq Dashboard under Settings > General).

Settings Panel

If your app supports iOS and Android, you will need to create two separate apps on the Tapdaq dashboard.

B. Network/Adapter Selection

Enable Cocoapods/Maven, then select the networks for each platform that required and click Save Adapters.

Dependencies

Dependending on the Play Service Resolvers Android settings for your project, these will either be added to the plugins/Android folder or the mainTemplate.gradle file

C. Play Services Resolver Settings

This integration method relies on the Play Services Resolver, based on the network selection it will add them to the iOS Podfile or the Android mainTemplate.gradle file.

Goto Assets > Play Services Resolver > iOS/Android Resolver > Resolver Settings to review settings.

The following settings are recommended:

iOS

  • Podfile Generation
  • Use Shell to Execute Cocoapods Tool (If not enabled, pod install must be run manually)

Android

  • Patch mainTemplate.gradle (Highly recommended for faster, more reliable builds)
  • Use Jetifier

3. Initialise Tapdaq

Create a script with the Tapdaq namespace below and add it to a GameObject in your scene.

using Tapdaq;

We recommend your script extends MonoBehaviour class type to ensure that all overridden methods are called such as Start, OnEnable, OnDisable and OnApplicationPause.

To initialise Tapdaq, simply put one of the following Init methods in the Start() function:

private void Start() {
  AdManager.Init(); //Unknown User.
  //OR
  AdManager.Init(TDStatus.TRUE, TDStatus.FALSE, TDStatus.UNKNOWN);//IsUserSubjectToGDPR, UserConsent, isAgeRestrictedUser
}

Consent must be acquired from EU users for networks to display personalised ads. Where it is unknown that a user is from the EU or consent has not been set to true, consent data will not be sent to ad networks

For more on GDPR and COPPA compliance, see the User Privacy section.

Callbacks are also available for notifications when Tapdaq has been initialise or failed to initialise. Add them like so:

private void OnEnable () {
	TDCallbacks.TapdaqConfigLoaded += OnTapdaqConfigLoaded;
	TDCallbacks.TapdaqConfigFailedToLoad += OnTapdaqConfigFailToLoad;
}

private void OnDisable () {
	TDCallbacks.TapdaqConfigLoaded -= OnTapdaqConfigLoaded;
	TDCallbacks.TapdaqConfigFailedToLoad -= OnTapdaqConfigFailToLoad;
}

private void OnTapdaqConfigLoaded() {
	//Tapdaq Ready to use
}

private void OnTapdaqConfigFailToLoad(TDAdError error) {
	//Tapdaq failed to initialise
}

4. Update GDPR consent

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

AdManager.SetUserSubjectToGDPR (TDStatus.TRUE);
AdManager.SetConsentGiven (true);
AdManager.SetIsAgeRestrictedUser (true);

For Mintegral: for users outside the EU UserSubjectToGDPR must be set to FALSE to receive ads. For users inside the EU UserSubjectToGDPR must be TRUE with ConsentGiven also TRUE to receive ads.

5. 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.

6. iOS specific steps

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 or HyprMX 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

You must also include you AdMob app ID in the Tapdaq settings panel in Unity. This will then be automatically added to your info.plist when you build.

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. Known Issues

When building iOS projects to Unity, frameworks may not be imported correctly, after selecting "Switch Platform" to iOS, select the Unity Editor window to allow our script to run, then go back and Select Build.

7. Android specific steps

A. AdMob AppId

You must also include you AdMob app ID in the Tapdaq settings panel in Unity. This will then be automatically added to your AndroidManifest.xml when you build.

B. AndroidManifest.xml & R.txt conflicts

When using FAN & YouAppi SDK's together, a conflict may arise if building with gradle between two unused files in each SDK, to resolve the issue, add these exclusion rules to you mainTemplate.gradle file:

android {
    packagingOptions {
        exclude 'AndroidManifest.xml'
	exclude 'R.txt'
    }
}

C. Facebook Audience Network

Videos ads on Facebook Audience Network require hardware acceleration to be enabled either on the application or activity level. See full details on the Facebook website

For Android P (9.0) devices, in order to load ads a config must be added to the AndroidManifest.xml, see full details on the Facebook website

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.