javascriptcordovamobileionic-frameworkionic2

Geolocation on non https will still work on Ionic apps?


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://sites.google.com/a/chromium.org/dev/Home/chromium-security/deprecating-powerful-features-on-insecure-origins for more details.

Geolocation API will be deprecated on non secure origin, but, what about local files on Ionic apps ? They said "localhost" is treated as secure origin, but it's not how cordova works.

Thanks for enlightening me.


Solution

  • Right now they are only deprecating http urls, cordova use file urls, so right now it will still work.

    I can't tell you if in the future google will decide to change that.

    Anyway, if google some day does that, cordova will have to use a geolocation plugin instead of using the webview implementation, and that will fix the problem, so don't worry.