Ionic Creator Geolocation not working in iOS


#1

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?


#2

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)


#3

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?


#4

Hello, did you find a solution for that?

I saw your other solution for this thread:

Adding cordova-plugin-ios-plist in Cordova Plugins in Creator.

Do you know how handle geolocation in ios throught Ionic Creator???


#5

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.