Source: https://developers.woosmap.com/products/geofencing-sdk/flutter-plugin/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 profiles and the difference between each profile is explained in
the [Tracking profiles documentation](/products/geofencing-sdk/tracking-profiles/tracking-profiles/)

## Start/Stop a tracking profile

Once you have initialised the plugin and user has authorised location permissions, you can start tracking  user’s
location.

To start tracking, call:

``` dart
Future<String?> returnVal = geofencingFlutterPlugin.startTracking('liveTracking');

returnVal.then((value){
    debugPrint(value!);
}).catchError((error) {
    debugPrint('An error occurred: ${error.message}');
});
```

To stop tracking, call:

``` dart
Future<String?> returnVal = geofencingFlutterPlugin.stopTracking();

returnVal.then((value){
    debugPrint(value!);
}).catchError((error) {
    debugPrint('An error occurred: ${error.message}');
});
```

Method `startTracking` accepts only following tracking profiles:
- **liveTracking**
- **passiveTracking**
- **optimalPassiveTracking**
- **visitsTracking**
- **beaconTracking**

## **passiveTracking** on iOS

If you enable passive tracking on the iOS App, it will use all **20 region slots** (`CLRegion`) assigned by the system to the application.  
If you plan to add another plugin that also relies on `CLRegion` geofencing, the SDK allows you to free up to **3 slots** for use by a third-party plugin.  
This can be configured as shown below.

### While initializing the plugin:

```dart
try {
      WoosmapGeofencingOptions options = WoosmapGeofencingOptions(
          protectedRegionSlot: config.protectedRegionSlot);
      Future<String?> returnVal = geofencingFlutterPlugin.initialize(options);
      returnVal.then((value) {
        showToast(value!);
      }).catchError((error) {
        showToast('An error occurred: $error');
      });
    } on PlatformException {
      showToast('An error occurred');
    }
```

### Or via a function call later:

```dart
geofencingFlutterPlugin.setProtectedRegionSlot(3);
```
