Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determining 3G vs Edge

I know that the reachability example allows detection of whether network is accessible via Wifi or Cell, but is there a way to determine whether the cell connection is over 3G or EDGE?

like image 573
iPhonedev Avatar asked Dec 06 '11 13:12

iPhonedev


1 Answers

As of iOS 7, there's now a public way to do so:

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);
}];

Read up more on my article in objc.io.

like image 167
steipete Avatar answered Sep 28 '22 15:09

steipete