检测iPhone是否处于飞行模式? [英] Detect if iPhone is in Airplane mode?

查看:344
本文介绍了检测iPhone是否处于飞行模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一种方法来检测iPhone是否处于飞行模式,我做了一些研究并发现:

I need a way to detect if the iPhone is in Airplane Mode or not, I did some research and found:

如何检查飞机模式?

哪个不起作用,我也知道我可以设置SBUsersNetwork在飞行模式下显示警报,但它会要求用户打开WIFI,但我的应用程序需要用户使用3G和WIFI根本不起作用,所以有任何直接在CoreTelephony,我可以做我的工作吗?

Which does not work, also I know I can set SBUsersNetwork to show an alert when in airplane mode, but it will ask user to switch on WIFI but my app need user to use 3G and WIFI simply does not work, so is there any straight forward way, in CoreTelephony that I can do my job?

谢谢!

推荐答案

基本上:不。你不可以做这个。你可以做的是使用Apple的可达性样本来检测如果网络连接可用。

Basically: no. You cannot do this. What you can do is use the Reachability samples from Apple to detect if a network connection is available.

这篇关于检测iPhone是否处于飞行模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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