2.3 iOS Integration

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

[CPE Advertising]

Users are attributed when they install and launch advertising apps.
Add following code in didFinishLaunchingWithOptions: method in AppDelegate class.

Method
  TnkSession : - (void) 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

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

{

    

    // Tnk Initialization

    [TnkSession initInstance:@"c01060e0-70d1-43f5-5f34-1d070e050302"];

    

    [[TnkSession sharedInstance] applicationStarted];

    

    self.window.rootViewController = self.viewController;

    [self.window makeKeyAndVisible];

    return YES;

}


[CPA Advertising]

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

Method
  TnkSession : - (void) actionCompleted

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

Sample code

- (void) loginCompleted:(id)sender {


    [[TnkSession sharedInstance] actionCompleted];

}

Comments