-1

As far as I know using reachability class , one can find if the device is connected with wifi or mobile data but what if both are kept on in the device.

Will we be able to know using reachability class ?

Is it possible to detect if data packets passes through mobile data or wifi when both are kept on

I couldn't find much about it.

any tips

Shankar Naik
  • 401
  • 5
  • 16

1 Answers1

0

In my experience, iPhone will use only one data connection at a time not both. indicated by which adapter symbol is showing in the menu bar. When you see the Wi-Fi symbol, your iPhone is using Wi-Fi for the internet.

Reachability *reachability = [Reachability 
reachabilityForInternetConnection];
[reachability startNotifier];

NetworkStatus status = [reachability currentReachabilityStatus];

if(status == NotReachable) 
{
 //No internet
}
else if (status == ReachableViaWiFi)
{
  //WiFi
}
else if (status == ReachableViaWWAN) 
{
  //Mobile data
}
Arvind
  • 1
  • 1
  • sometimes it interchangably uses mobile data when wifi is weak .. in thtat scenario the above code can detect the usage right ? – Shankar Naik Apr 11 '18 at 13:26