在 iOS 中检查蜂窝网络类型 [英] Checking cellular network type in iOS
问题描述
我正在开发一个 iOS 应用程序,并想确定该设备具有哪种类型的蜂窝网络连接.
I am working on an iOS app, and want to determine which type of cellular connection the device has.
我对我的设备使用的蜂窝网络类型最感兴趣:2G 或 3G,或其他.
I'm most interested in the kind of cellular network my device is using: 2G or 3G, or other.
然而,Reachability.h 只提供对 wifi 或 3G 的检查.
However, the Reachability.h only provides checking for wifi or 3G.
我如何检查 2G、3G 等?
How can I check for 2G, 3G, etc?
推荐答案
2G/3G 无法通过 Reachability.h
或任何其他第三方库来区分,因为 iPhone 只提供网络类型信息( WWAN, WiFi , 无网络 ) 到 API.
2G / 3G cannot be distinguished via Reachability.h
or any other third party libraries, as iPhone only provides network type information ( WWAN , WiFi , no Network ) to API.
但是,如果您能够知道 2G 或 3G 网络的 IP 范围,则可以确定 iPhone 使用的网络速度/频率.
However, if you are able to know the IP range of 2G or 3G network, you can determine which network speed / frequency the iPhone is using.
这篇关于在 iOS 中检查蜂窝网络类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!