Tracking Profiles
Start/Stop a tracking profile using React Native Plugin
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 tracking profile
Once you have initialized the plugin and the user has authorized location permissions, you can start tracking the user’s location.
To start tracking, call:
WoosmapGeofencing.startTracking('liveTracking')
.then((result: string) => {
console.log(value);
})
.catch((error: any) => {
alert('message: ' + error.message);
});
To stop tracking, call:
WoosmapGeofencing.stopTracking()
.then((value: any) => {
console.log(value);
})
.catch((error: any) => {
alert('message: ' + error.message);
});
Method startTracking
accepts only following tracking profiles:
- liveTracking
- passiveTracking
- 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:
var woosmapSettings: WoosmapGeofencingOptions = {
privateKeyWoosmapAPI: "<<WOOSMAP_KEY>>",
trackingProfile: "liveTracking",
protectedRegionSlot: 2
};
WoosmapGeofencing.initialize(woosmapSettings)
.then((value: string) => {
console.log(value);
})
.catch((error: any) => {
alert('message: ' + error.message);
});
Or via a function call later:
WoosmapGeofencing .setProtectedRegionSlot(3)