How to detect that WiFi has no internet connection?

In some cases the user connects to a WiFi network that doesn't have internet access. The OS itself is able to display a warning in System Settings:

However, in my app NWPathMonitor reports that the WiFi path is satisfied.

How could I detect that the internet access is not working while WiFi is connected?

I could try to connect to my own servers and report failures to the user, but that takes a long time to receive the timeout error. I cannot reduce the timeout, because maybe the user is on a very slow network and long loading time might be expected. But iOS can detect that there is not internet within a few seconds and display a warning, so I wonder how does Apple implement it in System Settings and if there is something I can implement in my app.

Answered by Engineer in 793602022

The only reliable way to determine if a wifi network has working internet it to attempt to make a network call. For your case, you'll want to create a route with a shorter timeout to quickly determine if the internet is "working".

Accepted Answer

The only reliable way to determine if a wifi network has working internet it to attempt to make a network call. For your case, you'll want to create a route with a shorter timeout to quickly determine if the internet is "working".

Also, see the discussion on this thread.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

How to detect that WiFi has no internet connection?
 
 
Q