Going by this https://ionicframework.com/docs/native/geolocation/
Trying this in browser:
this.platform.ready().then(() => {
console.log('platform is ready');
this.geolocation.getCurrentPosition().then(pos => {
console.log('lat: ' + pos.coords.latitude + ', lon: ' + pos.coords.longitude);
}).catch((error) => {
console.log('Error getting location', error);
});
});
I allow to use my location but get the following error:
PositionError {code: 2, message: "Network location provider at 'https://www.googleapis.com/' : Returned error code 400."}
Setting the geolocation manually fixes the problem:
What platform are you testing on and receiving this error?
Did you check network traffic on what URLs are called and what they respond?
I have the same problem… Nothing since I upgrade to new ionic native…
I have the same problem when trying to debug my app via VS Code - Cordova Tools Extension with option “Serve to the browser (ionic serve)”.
Any news here?
Can you try with another browser like Safari or Firefox?
I had the same issue, solved by changing the browser to firefox…
I was using Chrome - Version 60.0.3112.90 (Official Build), was not working.
I’m also getting the same error on Chrome - Version 60.0.3112.113 (Official Build)
Updated to Version 61.0.3163.91 (Official Build) and I’m not seeing the error anymore
Any news?
Same with me on chrome in windows 10.
polyfills.js:3 Unhandled Promise rejection: PositionError {code: 2, message: “Network location provider at ‘https://www.googleapis.com/ ’ : Returned error code 400.”}code: 2message: "Network location provider at ‘https://www.googleapis.com/ ’ : Returned error code 400."proto : PositionError ; Zone: ; Task: Promise.then ; Value: PositionError {code: 2, message: “Network location provider at ‘https://www.googleapis.com/ ’ : Returned error code 400.”} undefined
CookMe
September 23, 2017, 2:29pm
10
Nope, sorry. haven’t been working on this recently.