react-native-fused-location icon indicating copy to clipboard operation
react-native-fused-location copied to clipboard

FusedLocation.getFusedLocation() neither resolves nor reject.

Open shubhnik opened this issue 6 years ago • 1 comments

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.

shubhnik avatar Jan 28 '19 15:01 shubhnik

Hello @shubhnik did you find a solution for this problem ?

khaled-hbaieb avatar Dec 20 '22 10:12 khaled-hbaieb