Tracking Profiles

Start/Stop a tracking profile using iOS SDK

  1. Start/Stop a preset tracking profile
  2. Custom tracking profile

Tracking profiles aim to simplify the Woosmap Geofencing SDK integration.

The concept of Tracking profile and the difference between each profile is explained in the Tracking profiles documentation

Start/Stop a preset tracking profile

Once you have initialized the SDK and the user has authorized background permissions, you can start tracking the user’s location.

To start tracking, call:

swift
        WoosmapGeofenceManager.shared.startTracking(configurationProfile: ConfigurationProfile.passiveTracking)

    

Preset tracking profile details are listed in the Tracking properties page.

To stop tracking, call:

swift
        WoosmapGeofenceManager.shared.stopTracking()

    

Overload a tracking properties

Each Tracking Profile is defined in a Json file. If you need to adapt it to your specific use case, you can simply modify the Json file.

Some property has overload method like SearchAPIRequestEnable property:

swift
        WoosmapGeofenceManager.shared.setSearchAPIRequestEnable(enable: true)

    

Custom tracking profile

If preset tracking profiles don’t fit with your use cases, you can build your own profile and uses the startCustomTracking() method. There are two way to host the json file:

Local way:

swift
        let bundle = Bundle(for: Self.self)
let url = bundle.url(forResource: "localProfile", withExtension: ".json")
if (url != nil)
{
    let (status,errors) = WoosmapGeofenceManager.shared.startCustomTracking(url: url!.absoluteString)
    if (status == false) {
        for error in errors{
            print (error)
        }
    }
}
else
{
    print("url is nil")
}

    

External way:

java
        let url = "https://hostname/path/conf.json"
let (status,errors) = WoosmapGeofenceManager.shared.startCustomTracking(url: url)
if (status == false) {
    for error in errors{
        print (error)
    }
}

    

Build a custom tracking profile

Define tracking properties in a Json file that respect the Json Schema in the Tracking properties page.

Was this article helpful?
Have more questions? Submit a request