Geolocation plugin doesn't work on unsecured origin


#1

I am trying to use the geolocation plugin to get coordinates. And it keeps giving me a location error message with this message when i serve the app locally

getCurrentPosition() and watchPosition() are deprecated on insecure origins, and support will be removed in the future. You should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.

Does anyone know why this is happening?


#2

looks like this is only a “ionic serve” + Chrome issue since Chrome handles GPS location data as sensitive data. try another browser for development!