Skip to content

iOS Tracking Implementation Guide

Info

As of version 1.1.4, GPS geo-location data is not captured and will only be derived from the IP address. To capture GPS geo-location data (requires permission grant by user), please use version 1.1.3.

Abstract

In this section we will walk through how you can implement and verify WOGAA tracking for your mobile application on iOS

Warning

Do not reshare this document with anyone unless they need to implement WOGAA tracking on their mobile applications.


Latest Version

The latest version of WOGAA Mobile Trackers is 1.2.0. (Compiled with Xcode 11.4 with Swift 5.2)
WOGAA Mobile Tracker supports Swift and Objective-C for iOS.


Overview

  1. Install via CocoaPods, Carthage or Manually.
  2. Implement codes for iOS tracking.
  3. Check iOS implementation
  4. Verification of iOS implementation

Step 1. Install via CocoaPods, Carthage or Manually

Method 1: Install via CocoaPods

CocoPods is a dependency manager for Swift and Objective-C Cocoa projects.

  1. Create or update your Podfile. (see example below)
  2. Run pod install.

Podfile Example

source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/wogaa/Specs.git'

target 'MasterDetailExampleApp' do
  pod 'Tracker', '~> 1.1'
  use_frameworks!
end

Method 2: Install via Carthage

Carthage is another dependency manager to add frameworks to your Cocoa application.

  1. Create or update your Cartfile. (see example below)
  2. Run carthage update.
  3. Drag Tracker.framework in the directory Carthage/Build/iOS to your project.
  4. Add Tracker.framework into your Embedded Binaries.

Cartfile Example

binary "https://trackers.wogaa.sg/ios/Tracker.json" ~> 1.1`
  1. Download Tracker-1.2.0.zip.
  2. Unzip Tracker-1.2.0.zip.
  3. Drag Tracker.framework into your project.
  4. Add Tracker.framework into your Embedded Binaries.

Step 2. Implement codes for iOS Tracking

In your AppDelegate class for Swift,

  1. Add import Tracker.
  2. Add the following codes in application(:didFinishLaunchingWithOptions:) function for the appropriate environment.

For Staging

Tracker.start()

For Production

Tracker.start(for: .production)

In your AppDelegate class for Objective-C,

  1. Add #import <Tracker/Tracker.h>.
  2. Add the following codes in (void)applicationDidFinishLaunching:(UIApplication *)application; function for the appropriate environment.

For Staging

[Tracker start];

For Production

[Tracker startWith:EnvironmentProduction];


Step 3. Check iOS Implementation

Method 1: Manually check the logs

Example

[WOGAA Tracker] Started (1.2.0)
[WOGAA Tracker] Sent (1)

Info

[WOGAA Tracker] Started (1.2.0) shows tracker has started and the version number of the tracker
[WOGAA Tracker] Sent (1) shows number of successful event(s) being sent to our backend system

Method 2: Use tool to check if data is being received in your environment(s).

Info

  • Staging received events will take about 10 seconds to process. (Last 24 hours)
  • Production received events will take about 30 minutes to process. (Last 24 hours)

Step 4. Verification of iOS Implementation

A verification email will be sent once we have successfully received data from your mobile application.

It may take up to 7 working days for the verification. Please let us know if there is any issues with regards to this via wogaa@tech.gov.sg