2.4 Unity

Before proceeding this chapter, be sure that you already finished SDK settings. If not, check [5) Unity Settings] first.

[CPE Advertising]

Users are attributed when they install and launch advertising apps.
Add following code in Start() method of any GameObject.

Method
  - void applicationStarted()

Description
  To invoke this method, you have to get a Plugin object from TnkAd.Plugin.instance and then invoke this method using the instance. 
  Invoke this method as soon as your app is started. This method is executed in a background thread.
   * This method also collects analytics data. If you don't want this, you can turn it off. See 5. Analytics Report

Sample code

using UnityEngine;
using System.Collections;

public class TnkUITest : MonoBehaviour {

    void Start ()
    {

        TnkAd.Plugin.Instance.applicationStarted();

    }
    
    void Update ()
    {
    }
}


[CPA Advertising]

Users are attributed when they complete predefined mission such as 'login completed', 'signed up' or 'tutorial finished'.

Method
  - void actionCompleted()

Description
  To invoke this method, you have to get a Plugin object from TnkAd.Plugin.instance and then invoke this method using the instance. 
  Invoke this method when a user completes predefined mission. This method is executed in a background thread.

Sample code

    // when your action is completed.

    TnkAd.Plugin.Instance.actionCompleted();

Comments