Initialize Tracking with iOS SDK v5
    • 1 Minute to read
    • Dark
      Light

    Initialize Tracking with iOS SDK v5

    • Dark
      Light

    Article summary

    We recommend using the AppDelegate class to configure tracking for iOS mobile applications and the InterfaceController class to configure tracking for watchOS applications.

    The configuration functionality is the same for all supported OS versions, but some are called different depending on if you configure tracking for mobile or watch applications.

    Methods

    open func initWithConfiguration(
    	_ trackIDs: [Any], 
    	onTrackdomain trackDomain: String
    )

    Attributes

    Attribute

    Description

    trackIDs

    Mandatory.

    Enter the Track ID of the account(s) where you want to collect the data. You can provide more than one track ID if necessary.


    How to get the track ID

    trackDomain

    Mandatory.

    Enter the tracking domain (URL).

    Please be aware that SSL support is mandatory.

    Example

    trackDomain = "https://<trackingserver>"

    Configuration in iOS

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        MappIntelligence.shared()?.initWithConfiguration(
            [111111111111111, 222222222222222],
            onTrackdomain: "https://your-trackdomain.net"
        )
        return true
    }
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
        // Override point for customization after application launch.
        [[MappIntelligence shared] initWithConfiguration: @[@111111111111111, @222222222222222] onTrackdomain:@"https://your-trackdomain.net"];
        return YES;
    }

    Configuration in watchOS

    override func awake(withContext context: Any?) {
            super.awake(withContext: context)
             
            // Configure interface objects here.
            MappIntelligenceWatchOS.shared()?.initWithConfiguration([111111111111111 as UInt64, 222222222222222 as UInt64], onTrackdomain: "https://your-trackdomain.net")
        }
    - (void)awakeWithContext:(id)context {
        [super awakeWithContext:context];
     
        // Configure interface objects here.
        [[MappIntelligenceWatchOS shared] initWithConfiguration: @[@111111111111111, @222222222222222] onTrackdomain:@"https://your-trackdomain.net"];
    }

    Configuration in tvOS

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        MappIntelligence.shared()?.initWithConfiguration(
            [111111111111111, 222222222222222],
            onTrackdomain: "https://your-trackdomain.net"
        )
        return true
    }
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
        // Override point for customization after application launch.
        [[MappIntelligence shared] initWithConfiguration: @[@111111111111111, @222222222222222] onTrackdomain:@"https://your-trackdomain.net"];
        return YES;
    }

    Start Basic Page Tracking

    To start basic page requests and send the first requests to Mapp Intelligence, please navigate to the screen you want to track and call the track page method as described in the tracking Pages documentation.


    Was this article helpful?