I am trying hard to get the authentic internet connectivity status. I have used Apple\'s Reachability but it\'s only giving me the status of wifi connectivity i.e. not covering
I was getting too the Wifi flag even with it disconnected. There is a bug in the Reachability.m method:
- (NetworkStatus)networkStatusForFlags:(SCNetworkReachabilityFlags)flags
it uses a BOOL as return value, but it assigns to it the values of a struct with 3 values:
typedef enum : NSInteger {
NotReachable = 0,
ReachableViaWiFi,
ReachableViaWWAN
} NetworkStatus;
So if whether Wifi or Cellular are available, it will ReachableViaWiFi (as a BOOL can be 0 or 1, but not two)
To fix it, just change in the method above this:
BOOL returnValue = NotReachable;
For this:
int returnValue = NotReachable;
And you're good to go. Hope it helps.