This is a question about this page: Geolocation | W3C Geolocator Application API Plugin.
The documentation says:
For iOS you have to add this configuration to your **configuration.xml** file
<edit-config file="*-Info.plist" mode="merge" target="NSLocationWhenInUseUsageDescription">
<string>We use your location for full functionality of certain app features.</string>
</edit-config>
However, there is no configuration.xml
. There’s a config.xml
, and I assume that’s what is being referred to, but currently there are no <edit-config>
tags in my config.xml
, so I want to make sure I’m putting things in the right place. Should I be modifying config.xml
?
(Also note, in the iOS simulator, this feature seems to work even without modifying a config/configuration file. I’m not sure if that’s expected.)
Also note that the config.xml
file appears to be overwritten whenever I run ionic cap sync
, if that’s even the right file to modify.
Plse check the github doc for this cordova plugin. Beats the ionic copy of it in your link
Secondly, you are referring to capacitor commands in the last part of your post
That confuses me a bit
For this feature I reckon you either go for cordova plugin or capacitor
Not both
And I am not sure if capacitor needs config.xml
So what is your strategy: cordova or capacitor?
@Tommertom, the docs themselves refer to both cordova and capacitor. I’m using capacitor. Interestingly, the docs for many capacitor plugins, including this one, also involve installing cordova plugins. For example, the instructions for the geolocation plugin are:
npm install cordova-plugin-geolocation
npm install @ionic-native/geolocation
ionic cap sync
The documentation isn’t clear whether the instructions apply to both Cordova and Capacitor or just Cordova. It seems that config.xml
is overwritten each time I run ionic cap sync
so I assume I should not be manually editing it in a Capacitor project?
Hi @douglast - thx for this. I did not dig that deep into the docs nor have in depth experience with that plugin.
Generally - but this you probably know - it isn’t a good idea to put/edit stuff in folders that are populated by any CLI.
So sorry if I cannot be of further help.
Hi @douglast,
did you resolve this? I’m in the same situation now and do not know how to proceed as the documentation is confusing, and other posts suggest moving to the capacitor plugin instead.
Thanks for your help, although you might do other things now.
Edit: I found the solution here Ionic iOS Geolocation - Stack Overflow