A better solution I have found is to stopReachability and restart it before every connection. This forces it to grab the actual state and has solved all the problems
Reachability not returning correct state
-
24-09-2022 - |
Question
I have encountered an issue where Apple's reachability class returns an incorrect connection status, for example, it will return a connection to wifi when there is no active internet at all. It seems once the app gets into this state it can't get out unless you close it, or a new notification correctly triggers for the connection.
Has anyone had an issue like this?
Solution 2
OTHER TIPS
After some further investigation, Ive found that Apple Engineers recommend you don't use the reachability class they provide solely for detecting internet connections. As it can be unreliable.
Clearly.
The best solution is to check for connections using an NSURL connection and update all view controllers with a notification on success.
the answer post is here
Should I listen for reachability updates in each UIViewController?