我知道可达性示例允许检测网络是否可通过 Wifi 或 Cell 访问,但有没有办法确定小区连接是通过 3G 还是 EDGE?
最佳答案
从 iOS 7 开始,现在有一种公开的方式可以这样做:
CTTelephonyNetworkInfo *telephonyInfo = [CTTelephonyNetworkInfo new];
NSLog(@"Current Radio Access Technology: %@", telephonyInfo.currentRadioAccessTechnology);
[NSNotificationCenter.defaultCenter addObserverForName:CTRadioAccessTechnologyDidChangeNotification
object:nil
queue:nil
usingBlock:^(NSNotification *note)
{
NSLog(@"New Radio Access Technology: %@", telephonyInfo.currentRadioAccessTechnology);
}];
阅读更多关于 my article in objc.io. 的信息
关于objective-c - 确定 3G 与边缘,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8400340/