Confirm user's selection of “Don't Allow” location services

偶尔善良 提交于 2019-12-11 17:13:16

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!