mapbox / DEPRECATED-mapbox-ios-sdk

REPLACED – use https://www.mapbox.com/ios-sdk instead
https://github.com/mapbox/mapbox-gl-native
Other
323 stars 8 forks source link

Ask for "always" location permissions, too #659

Closed friedbunny closed 8 years ago

friedbunny commented 9 years ago

If an iOS app only has the NSLocationAlwaysUsageDescription key, we will never ask the user for location permission. This PR checks for both always and WhenInUse permission keys, then asks the user (with a preference for the less permissive WhenInUse).

Fixes #648 (technically supersedes) by @duemunk, thanks!

/cc @incanus

incanus commented 9 years ago

What happens on pre-iOS 8 when the Info.plist entry isn't required? What if they are deploying for iOS 5 through 7?

friedbunny commented 9 years ago

Pre-iOS 8 will continue to automatically ask for location permission when location services are first used. This code only runs on iOS >=8 because of the requestWhenInUseAuthorization selector check.