Ionic 2 geolocation plugin works only when reboot phone


#1

Hi,

Until a few weeks, my app works good. But since a days ago, the cordova geolocation plugin is not working correctly. I need to reboot the phone to make it works.

Any ideas? Here my code.

let locationOptions = {timeout: 50000, enableHighAccuracy: true};
 
            navigator.geolocation.getCurrentPosition(
 
                (position) => {
 
                    let options = {
                      center: new google.maps.LatLng(position.coords.latitude, position.coords.longitude),
                      zoom: 16,
                      mapTypeId: google.maps.MapTypeId.ROADMAP
                    }
                     alert(position.coords.latitude);
                    this.map = new google.maps.Map(document.getElementById("map"), options);
                },
 
                (error) => {
                    console.log(error);
                }, locationOptions
 
            );

Thanks


#2

Not working for me as well… even reboot won’t help… it keeps return me positionerror with no helpful message at all…


#3

This is weird, same issue. For me also rebooting solves the issue temporarily.
By the way, how do we get to prompt the user with the settings screen to enable GPS?