2.5 Cocos2dx

Before proceeding this chapter, be sure that you already finished SDK settings. If not, check [6) Cocos2dx Settingsfirst.

[CPE Advertising]

Users are attributed when they install and launch advertising apps.
Add following code in init() method of your main cpp class.

Method
  - void TnkPlugin::applicationStarted()

Description
   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

#include "TnkAdPlugin.h"


bool HelloWorld::init()

{

    // ...


    TnkAdPlugin::applicationStarted();

}



[CPA Advertising]

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

Method
  - void TnkPlugin::actionCompleted()

Description
   Invoke this method when a user completes predefined mission. This method is executed in a background thread.

Sample code

#include "TnkAdPlugin.h"


void HelloWorld::kakaoLogin() 

{

    // ....


    TnkAdPlugin::actionCompleted();

}

Comments