确认用户选择“不允许”。位置服务 [英] Confirm user's selection of "Don't Allow" location services

查看:78
本文介绍了确认用户选择“不允许”。位置服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在我的应用程序中使用位置服务。最初,该应用要求用户允许查找当前位置。如果用户说不允许,我可以再显示一个警报以确认该选择吗?然后,如果用户在第二个对话框中说允许,则应用程序可以获取当前位置吗?

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?

推荐答案

否不是,它是由系统管理的。

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

可以像这样进行检查:

if (![CLLocationManager locationServicesEnabled]) {
   // location can not be retrieved.

} 

这篇关于确认用户选择“不允许”。位置服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆