Tracking Profiles
Start/Stop a tracking profile using iOS SDK
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:
WoosmapGeofenceManager.shared.startTracking(configurationProfile: ConfigurationProfile.passiveTracking)
Preset tracking profile details are listed in the Tracking properties page.
To stop tracking, call:
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:
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:
- included in the client application (local)
- hosted externally in a file folder in your information system (external)
Local way:
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:
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.