mardi 2 décembre 2014

How do iOS8 Changes to Location interact with Settings and Alert?

I am converting an iOS7 background location iPhone app to iOS8 and have managed to get the LocationManager to provide coordinates again using many of the suggestions on this site.


I am only interested in requestAlwaysAuthorization not requestWhenInUseAuthorization.


However I cannot ever get iOS to prompt the user for permission to use location services and I am wondering if in some circumstances it should.


Can someone please answer the following questions:




  1. If my Privacy/Location Services/'my app' setting is "Never" does this prevent the app ever receiving GPS coordinates unless the app specifically directs the user to change that setting? (I only seem to receive coordinates if the Privacy/Location Services/'my app' setting is "Always")




  2. Does iOS ever prompt the user to specifically authorise GPS usage (as it used to do in previous iOS versions)? Under what circumstances? If not I assume the app has to raise a suitable UIAlert to direct the user to change Privacy/Location Services/ settings in response to didChangeAuthorizationStatus returning a status of: kCLAuthorizationStatusNotDetermined.




  3. The UIApplicationOpenSettingsURLString can be used to send the user to this app's settings page. However this does not display the Privacy/Location Services/'my app' page which is what the user needs to change if the current setting is preventing coordinates being returned. Is there a different way to programatically direct the user straight to the Privacy/Location Services/'my app' page for this app?




Many thanks for your assistance


Robert




Aucun commentaire:

Enregistrer un commentaire