0

Is it possible to detect which type of network we are using like wifi, DSL, very poor network ?

Actually my app is crashing in Very poor, 100% loss and high latency network.

Is there any way to detect this so I can reduce the load with respect to network condition?

Please help me.

Puneet Sharma
  • 9,369
  • 1
  • 27
  • 33
Navi
  • 1,696
  • 2
  • 17
  • 36

4 Answers4

2

You can use to some extent Apple's Reachability

For example you can ping a particular IP address and derive some metrics from the result

Community
  • 1
  • 1
Toni Toni Chopper
  • 1,833
  • 2
  • 20
  • 29
1

You couldn't detect a quality of your connection. But there is a nice class Reachability which represents few useful methods to detect connection states.

Valentin Shamardin
  • 3,569
  • 4
  • 34
  • 51
1

Look at Reachability.m. it'll tell you whether you have any connection, and then tell you what kind of connection you have. It tells every thing about network.

Download Rechability here

chandan
  • 2,453
  • 23
  • 31
1

you can download the Reachablity class. and add the following to check network type

Reachability* reachability = [Reachability sharedReachability];
[reachability setHostName:@"www.google.com"];    // set your host name here
NetworkStatus remoteHostStatus = [reachability remoteHostStatus];

if(remoteHostStatus == NotReachable) {NSLog(@"no");}
else if (remoteHostStatus == ReachableViaWiFiNetwork) {NSLog(@"wifi"); }
else if (remoteHostStatus == ReachableViaCarrierDataNetwork) {NSLog(@"cell"); }
Manish Agrawal
  • 10,958
  • 6
  • 44
  • 76