A user connects their iPhone to a VPN, opens your app and sees:
No internet connection. Please try again.
They switch to another app, which works.
Your app may have encountered a real failure. But “no internet” might be the wrong diagnosis.
A hostname lookup can fail. A secure connection can fail. An API can return an authentication error. The response can arrive successfully and then fail JSON decoding.
A failed API operation does not automatically mean the device is offline—or that the VPN caused the failure.
The first useful fix is to preserve those distinctions in your networking code.
Start with what actually failed
Think of an API operation as several stages:
Establish a usable network connection.
Resolve the destination hostname when needed.
Establish the secure connection.
Exchange the HTTP request and response.
Interpret the response body.
This is a debugging model, not a claim that every request creates a new connection or performs a fresh DNS lookup.…