如何确定用户是在iPhone上的Edge还是3G [英] How to determine whether user is on Edge or 3G on iPhone
问题描述
虽然在应用程序中以程序方式确定iPhone是否在Wifi或数据网络上是相对简单的,但我无法找到确定iPhone是在Edge还是3G上的方法。
Though it is relatively straightforward to determine if an iPhone is on Wifi or a data network programmatically in your application, I can't figure out a way to determine if the iPhone is on Edge or 3G.
有人想办法确定这个吗?
Anybody figure out a way to determine this?
注意:不担心Apple AppStore接受政策所以我不介意在我的应用程序中做一些hacky。 (尽管iPhone不应该被越狱)
Note: Not worried about Apple AppStore acceptance policies so I don't mind doing something hacky in my app. (The iPhones should not have to be jailbroken though)
推荐答案
iPhone不会以编程方式向开发人员提供此类信息。您可以期望的最好方法是确定是否必须通过单元网络路由到给定主机的连接 - 请参阅 SCNetworkReachability 参考和可达性项目更多。
The iPhone doesn't provide this kind of information to developers programmatically. The best you can hope for is to determine whether a connection to a given host will have to be routed over a cell network - see the SCNetworkReachability reference and the Reachability project for more.
这篇关于如何确定用户是在iPhone上的Edge还是3G的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!