How can i get the type of connection of a carrier network?
Reachability
class I
I am working on an iPhone application that requires the ability to recognize which type of internet connection is currently being used (Wifi, 3G, Edge, etc). I found a simple way to check by using Apples Reachability sample code. There seems to be a shortage of information about this online, I hope this can help someone.
First copy Reachability.m/.h into your project and include #include "Reachability.h" into your class.
Reachability *reach = [[Reachability alloc]init];
if (reach.internetConnectionStatus == NotReachable) {
NSLog(@"No Connection Found");
} else if (reach.internetConnectionStatus == ReachableViaCarrierDataNetwork) {
NSLog(@"3G or Edge");
} else if (reach.internetConnectionStatus == ReachableViaWiFiNetwork) {
NSLog(@"Wifi Connection");
}
[reach release];
This code may not be the best way to accomplish this, but it appears to be the most simple approach.