iOS 8 Geo Location Permissions Not Appearing? Here's how to fix!


#1

I was having issues with navigator.geolocation.getCurrentPosition() and iOS 8 never asking for permissions (and consequently failing.)

There are a few new permission types with iOS 8 and there are two things necessary for geolocation to function properly.

##First:##

Download:
CDVLocation.m at GitHub

And update (replace) this file found within your ionic project:
platforms/ios/*YourProjectHere*/Plugins/CDVLocation.m

##Second##

Update your .plist file found within your XCode project. In the Project Navigator, find the Resources directory and open the YourProjectHere-Info.plist by clicking it.

Add the following Key / Type / Values:

NSLocationAlwaysUsageDescription String Permissions Message for App even when not in use
NSLocationWhenInUseUsageDescription String Permissions Message for App when in use

You should now be able to compile and access geo location services in iOS 8!

This might very well not affect new projects but mine was not cooperating until I merged the updates.


ios7-8 geo location permission
Geolocation Plugin fails to prompt for permissions on ios 8 after the first time
#2

Thank you, sir: you just saved me a ton of work!


#4

Hi guys I badly need help, does this appear to you when your GPS is off?


#5

Amazingly and unbelievable, but it works!!! Its funny, but when such stuff happens (you follow someone’s guide you don’t understand) and it finally works I believe in myself more. Don’t know why.
Thanks!!!


#6

Thank you! That’s honestly the nicest thing I’ve ever received in my email. Thank you.


#7

Have you tried using this with the $ngCordova? I’m not sure if it’s just me, but I can’t get geolocation working after the first prompt for permissions.


#8

How about for Phonegap Build? is this fix doable?


#10

Just use add to Content-Security-Policy this: gap://ready file:

Full: