To initialize the tracking functionality, you have to perform the following steps:

Implementation Options

First, import the tracking classes to be able to use them in your source code.

import Webtrekk
CODE


Our tracking functionality is provided via the class "Webtrekk."

It is implemented as "singleton" and has to be initialized once. We recommend doing that in the "application" method of your AppDelegate.


Example

import UIKit
import Webtrekk
 
@UIApplicationMain
class AppDelegate: NSObject, UIApplicationDelegate {
  var window: UIWindow ?
 
   func application(
     application: UIApplication,
     didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject] ? ) - > Bool {
 
     try !WebtrekkTracking.initTrack()
     return true
   }
}
CODE

First, import the tracking classes to be able to use them in your source code.

import com.webtrekk.webtrekksdk.Webtrekk;
CODE


Our tracking functionality is provided via the class "Webtrekk."

It is implemented as "singleton" and has to be initialized once. We recommend doing that in the "onCreate" method of your MainActivity.


Example

private Webtrekk webtrekk;
 
@Override
protected void onCreate(Bundle savedInstanceState) {
     super .onCreate(savedInstanceState);
     setContentView(R.layout.activity_main);
 
     webtrekk = Webtrekk.getInstance();
     webtrekk.initWebtrekk(getApplication());
}
CODE


If you have made all required settings as described in the section "Configuring the App Tracking" the tracking functionality is now available. Initial requests can now be sent to your Mapp Intelligence account.