I installed it in a React Native project using Expo.
I followed the background location example provided in the package documentation: https://github.com/HyopeR/react-native-location/blob/master/example/src/pages/BackgroundPage/index.tsx
On iOS, the location observer works correctly:
- When the device location changes, the observer callback is triggered.
const onChange = useCallback<OnChangeEvent>(locations => {
if (locations.length > 0) {
const item = locations[0];
setLocation(item);
console.log(item);
}
}, []);
- This works both in foreground and background modes.
However, on Android, the behavior is broken. The location observer does not receive any updates at all, neither when the app is in the foreground nor when it is running in the background.
I installed it in a React Native project using Expo.
I followed the background location example provided in the package documentation:
https://github.com/HyopeR/react-native-location/blob/master/example/src/pages/BackgroundPage/index.tsxOn iOS, the location observer works correctly:
However, on Android, the behavior is broken. The location observer does not receive any updates at all, neither when the app is in the foreground nor when it is running in the background.