A. Show Offerwall

 * In 'Testing' state, you have to register your device as testing device in order to get ads displayed in your offerwall.


1) Set user name

You have to set user identification string using this API. Login Id is good for identification string.
If you don't have any user identification string, device Id will be fine for this. But please be sure to encrypt these strings when you are to use user's privacy data for identification string such as device Id, phone number and email.

These user identification strings are sent back to your server in parameters of callbacks and you can identify users using these strings. See 
1.6 Callback URL for detail.
(If you set 'Point Management' as 'Managed by Tnk' in the page of publishing configuration, you may skip this step.)

Method 
  - void setUserName(string userName)

Description
   To invoke these methods, you have to get a Plugin object from TnkAd.Plugin.instance and then invoke these method using the instance.

Parameters
 Name Description
 userName User identification String (less than 256 bytes)

Sample Code

using UnityEngine;
using System.Collections;

public class TnkUITest : MonoBehaviour {

    void Start ()
    {
        TnkAd.Plugin.Instance.setUserName ("haha12");
    }
    // ...
}

2) Show Offerwall (full screen)

Launch a incentive offerwall in full screen.

Method
  - void showAdList()
  - void showAdList(string title)

Description
   To invoke these methods, you have to get a Plugin object from TnkAd.Plugin.instance and then invoke these method using the instance.

Parameters
 NameDescription
 title Title displayed in the offerwall.

Sample Code

using UnityEngine;
using System.Collections;

public class TnkUITest : MonoBehaviour {

    void Start ()
    {
    }
    
    void Update ()
    {
    }
    
    void OnGUI ()
    {
        if (GUI.Button (new Rect (10030015080), "Show Offerwall")) {
            Debug.Log("Offerwall Ad");
            TnkAd.Plugin.Instance.showAdList("Get Free Diamond!");
        }
    }
}

3) Show Offerwall (popup view)

Launch a incentive offerwall in popup view.

Method
  - void popupAdList()
  - void popupAdList(string title)

Description
   To invoke these methods, you have to get a Plugin object from TnkAd.Plugin.instance and then invoke these method using the instance.

Parameters
 Name Description
 title Title displayed in the offerwall.

Sample Code

using UnityEngine;
using System.Collections;

public class TnkUITest : MonoBehaviour {

    void Start ()
    {
    }
    
    void Update ()
    {
    }
    
    void OnGUI ()
    {
        if (GUI.Button (new Rect (10030015080), "Popup Offerwall")) {
            Debug.Log("Offerwall Ad");
            TnkAd.Plugin.Instance.popupAdList("Get Free Diamond!");
        }
    }
}
Comments