Unity Plugin Integration

Follow

Before You Start

  • We support Unity version 4.6.8 and up.
  • We support Android Operating Systems Version 4.1 (API level 16) and up.
  • We support XCode 9.0 and up as well as CocoaPods.
  • We suggest creating an AdTiming account and registering an Android and/or iOS app.

Note: The download, use and access to the SDK is subject to the AdTiming Mobile SDK Publisher Online Terms & Conditions. If you do not agree to the terms of AdTiming Mobile SDK Publisher Online Terms & Conditions, do not download, access, or use the SDK, or the underlying services.

Overview

This Guideline is intended for publishers who need to monetize for an Unity app.

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 and MoPub.

Interested in Mediation? Integrate our Rewarded Video, Interstitial Ads in your app and follow our Add Mediation Networks and Mediation Integration Guides.

 

Step 1. Add the AdTiming Unity Package to Your Project

Disclaimer: Updating the AdTiming SDK

When upgrading from older SDK versions to the AdTiming SDK 5.5.0 and above, you must download and update all mediation adapters.

Follow these steps to add the AdTiming Unity Package to your project:

  1. Download Adtiming Unity Plugin
  2. Make sure your Unity project is opened in the Unity editor
  • The AdTiming SDK is designed to work with the Android & iOS platform. The Unity Editor contains a Simulator to work with Unity code. In order to work with our plugin, you must target either an Android or iOS build to test the integration.
  1. Import the Unity package.
  • Navigate to Assets -> Import Package -> Custom Package.

AddPlagin.png

  • Select the AdTimingUnityPlugin-x.x.x.unitypackage file..
  • Import all files and make sure to avoid conflicts with files. (Double-click on the extracted file; the different files will be populated automatically as shown below).

mceclip0.png

 

 

Step 2 Additional Settings for iOS

1. Add Ad-Support.framework to Your Xcode Project

Our Unity Plugin usually adds all the required frameworks automatically. In some cases, the AdSupport.framework can’t be added automatically using Unity 5. Verify if the framework has been added and in the case it has not been added automatically, make sure to add it manually.

2. iOS9 App Transport Security Settings

Important! In iOS9, Apple has added in controls around ‘ATS’. In order to ensure uninterrupted support for AdTiming Ad delivery across all Mediation Networks, it’s important to make the following changes in your info.plist:

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

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

WechatIMG3.png

Please Note: Make sure that your info.plist does not contain any other exceptions besides 'NSAllowsArbitraryLoads', as this might create a conflict.

 

Step 3. Initialize the Ad Units

Before loading ads, initialize the AdTiming SDK by calling AdTiming.Agent.Init(“appKey”, initListener) with your AppKey. This is best done at the time of the app launch, and only needs to be done once. Here’s an example of how to call Init() within the Start() method of a script attached to a GameObject. At the same time, the interface AdtInitListener must be implemented to receive events of the init() call and handle it accordingly.:

public void Start() 
{
AdTiming.Agent.init("Your AdTimingAppKey", new AdTimingInitListener());
}

class AdTimingInitListener : AdtInitListener
{
public void onError(string message)
{
Debug.LogError(message);
}

public void onSuccess()
{
Debug.Log("Init onSuccess");
}
}

 

isInitialized

After calling the init() method, you can also use the following code to determine whether the SDK has been successfully initialized.

// To determine the result of init()
AdTiming.Agent.isInitialized()

 

 

 

0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.