react-native-background-geolocation
react-native-background-geolocation copied to clipboard
MotionActivityType always "still" for android
MotionActivityType doesn't return value properly for the android device. For the iOS working as expected.
Your Environment
- React-Native Expo
- Plugin version: ^4.12.1
- Platform: Android
- OS version: Android(v.11) and most of the android device
- Device manufacturer / model: Oneplus 6T
- React Native version (
react-native -v): 0.69.6 - Plugin config
desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
disableElasticity: true,
stopTimeout: 2,
debug: false,
logLevel: BackgroundGeolocation.LOG_LEVEL_OFF,
stopOnTerminate: true,
startOnBoot: true,
batchSync: false,
autoSync: false,
locationAuthorizationRequest: 'WhenInUse',
Expected Behavior
The MotionActivityType always capture "still" for the android device. And some of the devices are capture "still" and "walking" which we supposes to capture the MotionActivityType based on the device whether user are walking, vehicle, etc... The "still" should be captured while we don't move.
Actual Behavior
The MotionActivityType must be captured based on the activity that user perform. For example, if user perform Walking Activity. It should capture as "walking/on_foot" and "still" while user stop/pause move.
Steps to Reproduce
- When the activity start:
await BackgroundGeolocation.start();
await BackgroundGeolocation.changePace(true);
BackgroundGeolocation.watchPosition(
(location) => {},
(errorCode) => {},
{
interval: 2000,
desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
}
);
}, []);
- start the capture the activity by using onLocation
useEffect(() => {
const locationSubscription = BackgroundGeolocation.onLocation(
(location) => {
addLocations(location); // record to our database
},
(error) => {
console.log('[onLocation] ERROR: ', error);
}
);
return () => {
locationSubscription.remove();
};
}, [addLocations]);
Context
Try with the different devices of android.
Debug logs
Logs
PASTE_YOUR_LOGS_HERE
The Motion api results are purely handled by the OS and depends upon the quality of sensors on the device (accelerometer, gyroscope, magnetometer).
the plug-in has no control over the quality of results. The Motion api is a black box provided by the OS. The Motion api exposes nothing more than an ON/OFF switch and an event-listener.
try restarting your device.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.