Installation of the Unity SDK

This SDK supports Unity versions no older than 5.4.0. iOS minimum version support is 8.0, Xcode 8.0 and Android minimum version support is API level 14. The following networks have higher minimum requirements:

Network Android API Level Xcode iOS Deployment Target
AdMob 14 Xcode 9.2 Deployment Target: 8.0
AppLovin 16 Xcode 8.0 Deployment Target: 9.0
Facebook AN 14 Xcode 8.0 Deployment Target: 9.0
HyprMX 14 Xcode 8.0 Deployment Target: 10.0
InMobi 15 Xcode 9.3 Deployment Target: 9.3
MoPub 16 Xcode 9.0 Deployment Target: 8.0
Tapjoy 14 Xcode 9.3 Deployment Target: 8.0
Vungle 14 Xcode 9.0 Deployment Target: 8.0
YouAppi 16 Xcode 10.2 (exact version) Deployment Target: 9.0

1. Installation

A. Tapdaq Base SDK

Download the SDK, and import the TapdaqUnity.unitypackage into your project. To do this, select Assets > Import Package > Custom Package..

B. Network SDK/Adapters

Download the network adapter packages that you want to use and import them in your project, only the base project is included in the TapdaqUnity.unitypackage. The network SDK's are included in the package, it's not required to fetch them from each network website.

2. Authenticate with Tapdaq

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.

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

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);

5. Lifecycle methods

Within each of your scenes, your script must override a MonoBehaviour method OnApplicationPause to report lifecycle events to Android ad network adapters.

void OnApplicationPause(bool pauseStatus)
{
    AdManager.OnApplicationPause (pauseStatus);
}

Note: This is only required for Android Receptiv Adapter. For iOS only applications this is not required

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

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

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.

8. Android specific steps

A. Play Services 17+

If using Play Services 17 (or higher), this will be required in your AndroidManfiest.xml

 <meta-data
            android:name="com.google.android.gms.ads.AD_MANAGER_APP"
            android:value="true"/>

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.