Reach on iOS 8 delayed?

The Reachability class from the Apple Reachability example code seems to work for quite some time when the user puts the device in airplane mode. I see about a 5 second gap between the user going into airplane mode and the actual notification.

Is there a faster way to get notified? or a new way for this OS?

+5
source share
1 answer

I built a sample that checks for connectivity rather than relying on notification. Therefore, simply by using the Reachability sample and checking the connection, you can determine if everyone is connected.

- (NetworkStatus)currentReachabilityStatus { NSAssert(_reachabilityRef != NULL, @"currentNetworkStatus called with NULL SCNetworkReachabilityRef"); NetworkStatus returnValue = NotReachable; SCNetworkReachabilityFlags flags; if (SCNetworkReachabilityGetFlags(_reachabilityRef, &flags)) { if (_alwaysReturnLocalWiFiStatus) { returnValue = [self localWiFiStatusForFlags:flags]; } else { returnValue = [self networkStatusForFlags:flags]; } } return returnValue; } 

This way you can find out what the connection status is, rather than hoping to be notified in a timely manner.

0
source

Source: https://habr.com/ru/post/1205233/


All Articles