locationManager:didFailWithError:如果用户位置服务已关闭,则不会调用 [英] locationManager:didFailWithError: not called if user Location Services are off

查看:184
本文介绍了locationManager:didFailWithError:如果用户位置服务已关闭,则不会调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

来自 locationManager:didFailWithError:


如果用户拒绝您的应用程序使用位置服务,
此方法报告kCLErrorDenied错误。收到这样的
错误后,您应该停止该位置服务。

If the user denies your application’s use of the location service, this method reports a kCLErrorDenied error. Upon receiving such an error, you should stop the location service.

当用户按不要允许问题MyApp想要使用您当前的位置,这样您就可以管理这种可能性。

It works when the user press "Don't Allow" to the question "MyApp Would Like to Use Your Current Location", so you can manage this eventuality.

但当用户按取消时,没有任何反应问题打开位置服务以允许MyApp确定您的位置(如果位置服务已关闭,则会出现此消息。

But nothing happen when the user press "Cancel" to the question "Turn On Location Services to Allow "MyApp" to Determine Your Location" (message which comes if Location Services are turned OFF.

有没有办法有任何形式回调?

Is there a way to have any kind of callback?

推荐答案

针对该特定情况使用 [CLLocationManager locationServicesEnabled]

Use [CLLocationManager locationServicesEnabled] for that particular case.

这篇关于locationManager:didFailWithError:如果用户位置服务已关闭,则不会调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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