CLLocationManager Fails to Request and Retain Authorization

Originator:spencer.samuel1
Number:rdar://17494065 Date Originated:27-Jun-2014 11:46 PM
Status:Closed Resolved:21-Aug-2014 6:30 PM
Product:iOS SDK Product Version:iOS 8: Seed 1, 2, 3, 4
Classification:High Reproducible:Always
 
Summary:
CLLocationManager consistently fails to request and retain authorization. When CLLocationManager does present the authorization dialog (which is rarely) it immediately forgets any user input (whether the user taps "Allow" or "Don't Allow"). Additionally, there is no difference between the requestWhenInUseAuthorization API and the requestAlwaysAuthorization.

When attempting to provide a front-end (user) workaround by prompting the user to open the settings app and change the privacy privileges, it also does not work. CLLocationManager fails to add any settings pane for the app requesting privileges in the Settings app. There are no app specific settings and nor are there app settings under Privacy > Location.

Steps to Reproduce:
1. Unzip and open the attached "Location Authorization" project in Xcode 6 (seed 2).
2. Run the project on iPhone 5S Simulator (or any other simulator).
3. Click on "Request When In Use Authorization" to call the requestWhenInUseAuthorization API.
4. If the dialog is presented, click "Allow".
5. Click "Reload Location" to show the current location on the MKMapView. If CLLocationManager successfully requests, allows, and retains location services for the app then the current location (must be set in the Simulator Debug menu) will display on the map. Otherwise, the app will prompt you to open the Settings app.
6. The app will attempt to open the app settings using the UIApplicationOpenSettingsURLString API.

Expected Results:
CLLocationManager should correctly prompt and retain the user for location services. CLLocationManager should be able to remember the user's input. It should also setup a settings pane in the Settings app (as seen in the WWDC '14 session videos).

Actual Results:
CLLocationManger does not present the location services alert dialog consistently. When it does present the dialog it does not remember what the user input (either "Allow" or "Don't Allow") and will display a prompt every time the requestWhenInUseAuthorization API is called. No settings pane or privacy settings appear.

Version:
iOS 8.0 (seed 2)

Notes:
See the "ViewController.m" file in the "Location Authorization" project for the code used (in the Steps to Reproduce).

Configuration:
iPhone Simulator (any model), iPhone device (any model)

Attachments:
'Location Authorization.zip' was successfully uploaded.

Comments

Update

This particular issue with CLLocationManager has been resolved in iOS 8 Seed 5. However, there are still issues with CLLocationManager.

By spencer.samuel1 at Aug. 21, 2014, 10:30 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!