disableMotionActivityUpdates property

bool? disableMotionActivityUpdates
getter/setter pair

Disable the plugin requesting "Motion & Fitness" (ios) or "Physical Activity" (android >= 10) authorization from the User.

Defaults to false. Set to true to disable asking the user for this permission.

iOS

The plugin is HIGHLY optimized for motion-activity-updates. If you do disable this, the plugin will drain more battery power. You are STRONGLY advised against disabling this. You should explain to your users with an appropriate NSMotionUsageDescription in your Info.plist file, for example:

"Motion activity detection increases battery efficiency by intelligently toggling location-tracking" off when your device is detected to be stationary.

Android

Android 10+ now requires run-time permission from the user for "Physical Activity".

Traditionally, the background-geolocation Android SDK has relied heavily upon the Motion API for determining when to toggle location-services on/off based upon whether the device is moving vs stationary. However, the Android SDK has a fallback "stationary geofence" mechanism just like iOS, the exit of which will cause the plugin to change to the moving state, toggle location-services and begin tracking. This will, of course, require the device moves a distance of typically 200-500 meters before tracking engages. With the Motion API authorized, the Android SDK typically requires just a few meters of movement for tracking to engage.

Example

BackgroundGeolocation.ready(Config(
  disableMotionActivityUpdates: true
));

Implementation

bool? disableMotionActivityUpdates;