You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This API is based on the W3C Geolocation API Specification, and only executes on devices that don't already provide an implementation.
I assumed that because my app runs on latest Safari in iOS (which provides an implementation of the geolocation API), that I would no longer require this plugin. I removed the plugin, but iOS no longer allows access to geolocation.
Problem
If you remove the plugin and deploy on iOS (using a non-https url), you will get the following error when trying to use navigator.geolocation:
[blocked] Access to geolocation was blocked over insecure connection to ionic://localhost
What is expected to happen?
According to the documentation, I would have expected to be able to use the navigator.geolocation API (without this plugin) for any Cordova application. For iOS, however the plugin is still required because of the limitation Apple has placed on the geolocation API on insecure URLs. Furthermore, the documentation seems to indicate that the plugin does nothing at all if the API is available in the browser. Clearly, that is not true. It appears that it clobbers the API, whether it exists or not (and I am glad it does :D).
Environment, Platform, Device
An Ionic app
iOS only
Version information
I am using @ionic/angular 4.11.1, and cordova-plugin-ionic-webview 4.0.0
It could be more clear because i believe the plugin is still required to mark capabilities and/or provide the native permission modal, regardless if the browser provides a geolocation api or not.
For example the plugin doesn't actually implement the geolocation api for android, but it does handle the permissions.
Bug Report
Looking at this in the documentation:
I assumed that because my app runs on latest Safari in iOS (which provides an implementation of the geolocation API), that I would no longer require this plugin. I removed the plugin, but iOS no longer allows access to geolocation.
Problem
If you remove the plugin and deploy on iOS (using a non-https url), you will get the following error when trying to use
navigator.geolocation
:What is expected to happen?
According to the documentation, I would have expected to be able to use the
navigator.geolocation
API (without this plugin) for any Cordova application. For iOS, however the plugin is still required because of the limitation Apple has placed on the geolocation API on insecure URLs. Furthermore, the documentation seems to indicate that the plugin does nothing at all if the API is available in the browser. Clearly, that is not true. It appears that it clobbers the API, whether it exists or not (and I am glad it does :D).Environment, Platform, Device
An Ionic app
iOS only
Version information
I am using @ionic/angular 4.11.1, and cordova-plugin-ionic-webview 4.0.0
Checklist
The text was updated successfully, but these errors were encountered: