react-native-fused-location
react-native-fused-location copied to clipboard
FusedLocation.getFusedLocation() neither resolves nor reject.
I am using this library to turn on gps --> https://github.com/Richou/react-native-android-location-enabler.
If the gps is off, the above mentioned library will show a popup and I turn on the gps then FusedLocation.getFusedLocation()
will neither resolve nor reject. Once I restart the app and since the gps was turned on the previous run now FusedLocation.getFusedLocation()
does returns the location. Here is my code 👇
export const getLocation = async () => {
try {
await RNAndroidLocationEnabler.promptForEnableLocationIfNeeded({ interval: 10000, fastInterval: 5000 })
const location = await FusedLocation.getFusedLocation();
return location;
} catch (error) {
console(error)
return undefined
}
};
Do you know of any fixes or what I maybe doing wrong? Thanks.
Hello @shubhnik did you find a solution for this problem ?