Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FusedLocation.getFusedLocation() neither resolves nor reject. #39

Open
shubhnik opened this issue Jan 28, 2019 · 1 comment
Open

FusedLocation.getFusedLocation() neither resolves nor reject. #39

shubhnik opened this issue Jan 28, 2019 · 1 comment

Comments

@shubhnik
Copy link

shubhnik commented Jan 28, 2019

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 shubhnik changed the title FusedLocation..getFusedLocation() neither resolves nor reject. FusedLocation.getFusedLocation() neither resolves nor reject. Jan 28, 2019
@khaled-hbaieb
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants