How can I programmatically detect EDGE network or

2019-02-01 14:17发布

I need to detect the EDGE network and bad network in the iPhone.

1) How to detect the bad network ?

2) Is it possible to detect EDGE network separetly ?

3) How can I get the strength of the network ?

Please give some answer about these questions. Thanks in advance.

1条回答
不美不萌又怎样
2楼-- · 2019-02-01 14:31

On iOS7, you can!

http://www.objc.io/issue-5/iOS7-hidden-gems-and-workarounds.html

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);
}];
查看更多
登录 后发表回答