Reachability doesn't detect LTE/5G on iOS 14/iPhone 12

I use Reachability (https://developer.apple.com/library/archive/samplecode/Reachability/Introduction/Intro.html#//apple_ref/doc/uid/DTS40007324) for detect network status.

Not always, but in some cases( 5G / iPhone12, iOS 14 ?) can't detect network status when use LTE.

when turn off LTE and use Wifi then it works.

the other apps are running on LTE, same device.

you have any idea?

I would recommend against using the Reachability APIs. Network preflight checks will lead to endless edge cases and race conditions similar to what you are pointing out here.

My recommendation for HTTP requests would be to try the request and if the device is offline then URLSession will immediately fail the request. If URLSession is not immediately failing then put a client timeout on the URLRequest.

If you are using a low level networking API like NWConnection then use the stateUpdateHandler to evaluate the NWConnection.State. If the NWConnection is already setup and you are seeing issues during a send() call, check the NWConnection.State of the connection before sending data if you absolutely need to.

Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com
Reachability doesn't detect LTE/5G on iOS 14/iPhone 12
 
 
Q