I am using the cordova-plugin-geolocation in my ionic creator app, and it is working on android and the web preview. However, I cannot get it to work on iOS device. It never asks for permission to access my location.
Is there a trick to doing that?
I am using the cordova-plugin-geolocation in my ionic creator app, and it is working on android and the web preview. However, I cannot get it to work on iOS device. It never asks for permission to access my location.
Is there a trick to doing that?
Make sure you have the cocoa keys set in your info.plist.
For Geolocation, you can use “NSLocationWhenInUseUsageDescription” (https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html)
I’m using Ionic Creator. They handle the info.plist construction for me. Is there a way to add something to it, or handle it programatically?
Hello, did you find a solution for that?
I saw your other solution for this thread:
https://forum.ionicframework.com/t/cordova-camera-will-not-work-without-permissions/119449
Adding cordova-plugin-ios-plist in Cordova Plugins in Creator.
Do you know how handle geolocation in ios throught Ionic Creator???
I found a “solution”. You have to replace plugin “cordova-plugin-geolocation” by “cordova-plugin-geolocation-ios-fixed”, basically they are same plugin but with problem of IOS resolved.
You can take look at:
https://www.npmjs.com/package/cordova-plugin-geolocation-ios-fixed
If you enter in a map, IOS device will ask you for permission to acces location.
In the other hand, i said “solution” because i am testing if there are side effects because replace one plugin by other.
Regards.