Source: https://developers.woosmap.com/products/geofencing-sdk/ios-sdk/guides/start-tracking-profiles/

> For clean Markdown of any page, append `.md` to the page URL.

> For a complete documentation index, see https://developers.woosmap.com/llms.txt

# Tracking Profiles



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](/products/geofencing-sdk/tracking-profiles/tracking-profiles/)

## 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.](/products/geofencing-sdk/tracking-profiles/tracking-properties/)

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:
- included in the client application (local)
- hosted externally in a file folder in your information system (external)

**Local way:**

```swift
let bundle = Bundle(for: Self.self)

if let url = bundle.url(forResource: "localProfile", withExtension: ".json")
{
    Task {
        let (status,errors) = await WoosmapGeofenceManager.shared.startCustomTracking(url: url.absoluteString)
        if (status == false) {
            for error in errors{
                print (error)
            }
        }
    }
}
else
{
    print("url is nil")
}
```

**External way:**

```swift
let url = "https://hostname/path/conf.json"
Task{
    let (status,errors) = await 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.](/products/geofencing-sdk/tracking-profiles/tracking-properties/)
