Geolocation plugin doesn't work on unsecured origin

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 for more details.

Does anyone know why this is happening?

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