triggerActivities property
Configures a comma-separated list of motion-activities which are allow to trigger location-tracking.
⚠️ Warning: Requires that the user grant your app the "Motion/Health" permission.
These are the comma-delimited list of activity-names returned by the ActivityRecognition
API which will trigger a state-change from stationary to moving. By default, the plugin will trigger on any of the moving-states:
Activity Name |
---|
in_vehicle |
on_bicycle |
on_foot |
running |
walking |
If you wish, you can configure the plugin to only engage the moving state for vehicles-only by providing just "in_vehicle"
, for example.
Example
// Only trigger tracking for vehicles
BackgroundGeolocation.ready(Config(
triggerActivities: 'in_vehicle'
));
// Only trigger tracking for on_foot, walking and running
BackgroundGeolocation.ready(Config(
triggerActivities: 'on_foot, walking, running'
));
Implementation
String? triggerActivities;