Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the rules behind "X would like to use your current location" on the iPhone?

Using location-awareness on the iPhone triggers the "X would like to use your current location" - "Don't allow"/"OK". In the CLLocationManager documentation, it is stated:

"The user has the option of denying an application’s access to the location service data. During its initial uses by an application, the Core Location framework prompts the user to confirm that using the location service is acceptable. If the user denies the request, the CLLocationManager object reports an appropriate error to its delegate during future requests."

I found the "initial uses" to be two times if you hit "OK" to allow location services. From the third time on, the iPhone will remember your setting for all future uses of the application.

However, a user pressing "Don't allow" will constantly be bothered every time a part of the application tries to uses location services. I've tried at least 15 times in my own app, and have tapped "Don't allow" even more in the "Vancouver 2010 - official mobile spectator guide". This is extremely annoying for users not wanting to use this feature.

My questions:

  • For all applications, iPhone will ask two times and remember the setting if you hit "OK". Is this a correct observation?
  • Is there a limit on the amount of tries iPhone will continue to ask if you hit "Don't allow", or is this never remembered? How do you handle this? Since locationManager:didFailWithError: is notified, I guess it could increase a counter property each time and persist this. The next time the application is used this setting is checked in my own code. If counter >= 2, don't use core location.
  • The only way I found to remove the "OK" setting once remembered, is by resetting it for ALL applications in General -> Reset -> Location warnings. Is there a way to do this only for one application, or from my own code?
like image 541
Mads Mobæk Avatar asked Feb 18 '10 09:02

Mads Mobæk


2 Answers

  1. Yes, it will always ask you twice. Kind of weird and unintuitive imho. It's my understanding that this is in case you hit the wrong button the first time. After that it assumes you know what you wanted.

  2. I found the following in the LocateMe example:

    "Don't Allow" on two successive app launches is the same as saying "never allow". but I've also read that other folks are seeing the same behavior that you are. Maybe a change in recent OS update? Anyways, your approach sounds reasonable.

  3. I don't believe that you can reset for only one app, sorry.

like image 73
cagreen Avatar answered Nov 17 '22 07:11

cagreen


You can now set or unset for one app in the settings, under General, Location Services. Probably introduced in 4.0?

And if you are a registered developer, you could check the API diffs for the latest beta. They might have improved error handling.

like image 1
Bjinse Avatar answered Nov 17 '22 07:11

Bjinse