检查 GPS 警报是否存在
我想检查我的窗口上是否已存在警报。该警报是 GPS 的警报(诸如“您的应用程序”之类的警报将使用您当前的位置以及“不允许”和“允许”按钮)。如果屏幕上出现此警报,我想设置一些标志。如果有人知道的话,请帮我解决这个问题。
I want to check if an alert is already present on my window or not. The alert is that of GPS (sumthing like "your app" will like to use your current location with Don't Allow and Allow buttons). I want to set some flag if this alert is present on screen. If anyone knows it, then please help me in getting this solved.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这将有助于...
this will help...
如果您正在针对ios4.2或更高版本进行开发,则可以使用
CLLocationManager
类的authorizationStatus
。为此,您需要检查
[CLLocationManagerauthorizationStatus]
变量,如果其值为kCLAuthorizationStatusNotDetermined
,那么将显示警报。在iOS 5或更高版本中,这是一个选项,用户可以通过该选项重置位置警告,在这种情况下,状态也将为
kCLAuthorizationStatusNotDetermined
。因此,如果您的应用程序正在运行并且用户切换到设置以重置该属性,那么您将需要实现以下CLLocationManagerDelegate
委托方法。谢谢,
If you are developing for ios4.2 or later than you can
authorizationStatus
ofCLLocationManager
class.For this you will need to check
[CLLocationManager authorizationStatus]
variable if its value iskCLAuthorizationStatusNotDetermined
then it the alert will be shown.In iOS 5 or later their is one option through which use can reset the location warning in that case also the status will be
kCLAuthorizationStatusNotDetermined
. So if your application is running and user switches to setting to reset that property than you will need to implmenet the following delegate method ofCLLocationManagerDelegate
.Thanks,