If you have built your application using the iOS 7 SDK before, and now you are using the iOS 8 SDK, chances are you need to do some code changes to correctly support iOS 8. One of them is the use of Location Services, or the CLLocationManager class. If you do not perform the needed changes, you will see that your app does not try to retrieve GPS or location information. If your app is newly installed, the location permission dialog will not be displayed.

As a summary, you will need to apply the following code changes to CLLocationManager in iOS 8:

  1. Add the following keys to your Info.plist file depending on your needs, and give them a string value. The string value explains why you need to get the user’s location information, so you should give it something like “Location information is needed in order to provide you with better user experience.” This string will be displayed to the user when the location permission dialog is displayed.

  2. If your app is localized, you can also localize the above strings by adding entries in your InfoPlist.strings file.

  3. Before calling CLLocationManager‘s startUpdatingLocation, call one of the following methods, depending on your needs.
    If you still support iOS 7 and below, you need to put a guard to avoid an “unknown selector” crash.

  4. If you have been using the kCLAuthorizationStatusAuthorized in your code before, you may need to change this to either kCLAuthorizzationStatusAuthorizedWhenInUse or kCLAuthorizationStatusAuthorizedAlways. Note that kCLAuthorizationStatusAuthorized is equal to kCLAuthorizationStatusAuthorizedAlways.

More details can be found on this very good blog post:
http://nevan.net/2014/09/core-location-manager-changes-in-ios-8/

Happy Goals for iOS

Happy Goals for iOS

Want an app to help you track and achieve your goals, without the complex stuff, saving you from headaches? Checkout Happy Goals - Habits & Goals Tracker now in the App Store! Happy Goals has been featured in the App Store in over 32 countries. Start now, better late than never!

 

Thank you!

%d bloggers like this: