react-native-background-geolocation
react-native-background-geolocation copied to clipboard
Activity type always returns unknown with confidence 100
Your Environment
- Plugin version: 3.9.3
- Platform: iOS
- OS version: iOS 14.2
- Device manufacturer / model: Apple iPhone 11
- React Native version (
react-native -v): 3.2.1 - Plugin config
{
// Geolocation Config
disableLocationAuthorizationAlert: true,
desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
distanceFilter: -1,
stationaryRadius: 10,
preventSuspend: true,
disableElasticity: true,
// We have our own stationary state
disableStopDetection: false,
disableMotionActivityUpdates: false,
pausesLocationUpdatesAutomatically: false,
isMoving: true,
// Application config
debug: true, // <-- disable this hear sounds for background-geolocation life-cycle.
logLevel: BackgroundGeolocation. LOG_LEVEL_VERBOSE,
notification: {
priority: BackgroundGeolocation.NOTIFICATION_PRIORITY_MIN,
},
stopOnTerminate: true, // <-- Don't allow the background-service to continue tracking when user closes the app.
startOnBoot: false, // <-- Don't auto start tracking when device is powered-up.
reset: false,
locationAuthorizationRequest: 'WhenInUse',
},
Expected Behavior
We expect the activity property of onLocation or the respective callback onActivityChange to contain one of the following: still, on_foot, in_vehicle, on_bicycle, running.
Actual Behavior
onLocationChange is never triggered and onLocation returns activity: type: "unknown", confidence: 100.
Steps to Reproduce
2. 3. 4.
Context
Debug logs
Logs
- Is this in iOS Simulator? The Motion API doesn't work in the simulator.
- Have you denied the Motion and Fitness permission?
@christocracy Yes, it's in the iOS Simulator. Thanks for the heads up! Sorry, didn't see it in the docs. I'll try on device.
When posting an issue, specify when you're using the Simulator.
- Plugin version: 3.9.3
- Platform: iOS
- OS version: iOS 14.2
- Device manufacturer / model: Apple iPhone 11
- React Native version (
react-native -v): 3.2.1