问题
I am using location services in my app. Initially the app asks the user to allow finding the current location. If the user says "Don't Allow", can I show one more alert to confirm that choice? Then, if the user says "Allow" in that second dialogue, can the app get the current location?
回答1:
No you can't, it is managed by the the system.
You can/should check if the user allowing you app to get the current location. Because you can change this in the settings app
Check can be done like this:
if (![CLLocationManager locationServicesEnabled]) {
// location can not be retrieved.
}
回答2:
i think.................. its a not possible beacuse its a default setting of iPhone ....
if u get answer please reply ....in this page...... but u change the setting of iphone, go to setting icon , go to general icon , go to current location and on this button...
sry for poor english
回答3:
The question is who is showing the second message. If it's CoreLocation that is showing the message than the last answer is the one that counts - so if it was "allow" then you can.
However - if after the "Disallow" you show your own custom message - the answer there has no affect. It must come from CoreLocation
来源:https://stackoverflow.com/questions/7360188/confirm-users-selection-of-dont-allow-location-services