How can i get the type of connection of a carrier network?
Reachability
class I'm able to get network flags
Reachability Flag Status: WR t------ localWiFiStatusForFlags
I'm able to get WIFI SSID using CaptiveNetwork
Supported interfaces: ( en0 )
en0 => { BSSID = "xx:xx:xx:xx:xx:xx"; SSID = MyWifiNetwork; SSIDDATA = <x1x1x1x1 x1x1x1x1 x1>; }
But i'm not able to differenziate 3G, EDGE or GPRS connection.
Any idea also using iOS private API?
thanks.
EDGE, or Enhanced Data GSM Evolution, is another type of 2G technology network. EDGE is slightly faster than GPRS with a download speed over two-times faster at 384Kbps. Because of its speed, it's sometimes referred to as a 2.5G network.
Enhanced Data rates for GSM Evolution (EDGE) also known as Enhanced GPRS (EGPRS), IMT Single Carrier (IMT-SC), or Enhanced Data rates for Global Evolution) is a digital mobile phone technology that allows improved data transmission rates as a backward-compatible extension of GSM.
EDGE is sometimes called a 2.5G network as it also has some characteristics of a 3G network but it doesn't satisfy the specification. Therefore you can say that EDGE lie between 2G and 3G.
GPRS is a 2.5G wireless communication that is supposed to give you 56kbps - 114 kbps while EDGE is denoted by the symbol E. The EDGE is the next level up giving you roughly twice the bandwidth of GPRS. On the other end is HSDPA denoted by the symbol H which is the next generation of 3G. It is called 3G+ or 3.5G.
From iOS 7 on you can use:
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); }];
I have also found this to detect a slow or fast connection:
- (BOOL)isFast:(NSString*)radioAccessTechnology { if ([radioAccessTechnology isEqualToString:CTRadioAccessTechnologyGPRS]) { return NO; } else if ([radioAccessTechnology isEqualToString:CTRadioAccessTechnologyEdge]) { return NO; } else if ([radioAccessTechnology isEqualToString:CTRadioAccessTechnologyWCDMA]) { return YES; } else if ([radioAccessTechnology isEqualToString:CTRadioAccessTechnologyHSDPA]) { return YES; } else if ([radioAccessTechnology isEqualToString:CTRadioAccessTechnologyHSUPA]) { return YES; } else if ([radioAccessTechnology isEqualToString:CTRadioAccessTechnologyCDMA1x]) { return NO; } else if ([radioAccessTechnology isEqualToString:CTRadioAccessTechnologyCDMAEVDORev0]) { return YES; } else if ([radioAccessTechnology isEqualToString:CTRadioAccessTechnologyCDMAEVDORevA]) { return YES; } else if ([radioAccessTechnology isEqualToString:CTRadioAccessTechnologyCDMAEVDORevB]) { return YES; } else if ([radioAccessTechnology isEqualToString:CTRadioAccessTechnologyeHRPD]) { return YES; } else if ([radioAccessTechnology isEqualToString:CTRadioAccessTechnologyLTE]) { return YES; } return YES; }
Here the OLD
solution, using private API, in particular SoftwareUpdateServices.framework
Class NetworkMonitor = NSClassFromString(@"SUNetworkMonitor"); NSLog(@"TYPE: %d", [NetworkMonitor currentNetworkType]);
It returns:
0: NO DATA
1: WIFI
2: GPRS/EDGE
3: 3G
hope this helps community.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With