webyonet / react-native-android-location-services-dialog-box

React Native Android Location Services Dialog Box
MIT License
182 stars 50 forks source link

It takes too much time to fetch location #47

Closed Shashi147 closed 6 years ago

Shashi147 commented 6 years ago

In some phones it gets into the loop and don't fetch the location.. Until you switch off and on the phone you cannot fetch the location .So please help in this regard.

webyonet commented 6 years ago

explain the error more clearly with code examples

Shashi147 commented 6 years ago

same code as you shown . Most of the time even if the location is on it doesn't call success, it throws the error message mostly in Mi and Oneplus devices please help me in this.

webyonet commented 6 years ago

enableHighAccuracy set to false and try again

    LocationServicesDialogBox.checkLocationServicesIsEnabled({
        message: 'Use Location ?',
        ok: 'YES',
        cancel: 'NO',
        enableHighAccuracy: false // <=== this
    }).then(function(success) {
            navigator.geolocation.getCurrentPosition((position) => {
                // your code
            }, error => console.log(error), {
                enableHighAccuracy: false, // <=== this
                timeout: 20000, 
                maximumAge: 1000 
            });
        }.bind(this)
    ).catch((error) => console.log(error.message));
Shashi147 commented 6 years ago

Hi, Thanks for replying.I will check and let you know.

Thanks & Regards Shashank H N

On Mon, Apr 30, 2018, 3:35 PM G.Burak notifications@github.com wrote:

enableHighAccuracy set to false and try again

LocationServicesDialogBox.checkLocationServicesIsEnabled({
    message: 'Use Location ?',
    ok: 'YES',
    cancel: 'NO',
    enableHighAccuracy: false // <=== this
}).then(function(success) {
        navigator.geolocation.getCurrentPosition((position) => {
            // your code
        }, error => console.log(error), {
            enableHighAccuracy: false, // <=== this
            timeout: 20000,
            maximumAge: 1000
        });
    }.bind(this)
).catch((error) => console.log(error.message));

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/webyonet/react-native-android-location-services-dialog-box/issues/47#issuecomment-385357574, or mute the thread https://github.com/notifications/unsubscribe-auth/AJLMQPbauxttYBZiWFVxX7Y4cCRwzspeks5ttuH-gaJpZM4TVBNC .