Does it work for VPN connection ?
Hi,
I am not getting correct reachability status when device is connecting/disconnecting from VPN. Does it actually support ?
Same here, I was (and am currently) getting the correct status on 10.1.1, but not later iOS versions.. oddly.
I am also seeing the same behavior on iOS 10.3.1 over VPN. It seems that Reachability thinks there is an internet connection but there actually is not.
Yea i've done some digging at the SCNetworkReachabilityFlags used by this library. They seem to have odd behaviour in 10.3.x (or sometime after 10.1.1). For 1) you will get weird instances where all flags are engaged, or all are engaged but the reachable flag is false. 2) Flipping to airplane mode with a VPN engaged gives you an instant where they are true (mainly transient, wifi, reachable flags), when they are false - although they immediately flip to false. 3) Turning airplane mode off from on the same flags flip to true, and then false. This may be due to a lag between the VPN engaging but I haven't dug enough to debug when that click happens - hard to get the moving components in sync.
In any case I filed a bug report with apple, so i'll see if anything comes back from that. My understanding is no one can touch the system config flags like SCNetworkReachability, so maybe something changed that wasn't documented or otherwise broke.
So all in all it doesn't seem like this library is at fault, the flags are not behaving as we expect.
@agnosticdev also I think we are getting different behaviour. Mine is always false when our VPN is engaged. But just incase; the the SCNetworkReachabilityFlags detect if you could maybe connect to the internet, but doesn't do the check, mainly for diagnosis of problem or a quick initial check - I don't think this repo does either. So connecting to a router with no internet connection will return true. Likewise if your on WiFi or cell is connected and you're app forces connection through a VPN which is off, it should (from what I understand) return true - even though your app is effectively offline.
@WesleyHunt I am now seeing similar issues with SCNetworkReachabilityFlags not responding correctly over WiFi, but I think you are correct in that SCNetworkReachabilityFlags is the main issue here and not this project. I have now completely move away from this project and am able to detect WWAN properly but am not really able to make a clear distinction between no connection and Wifi, like you mentioned because the app is not forcing the connection.
I am updating to iOS 10.3.2 just to see if there was any impact or resolution here. Do you have a link to the Radar for this bug?
Hey sorry I've been away for a while, bit busy before I left so I never got around to making a Radar, not sure where the bug report info went to to make it unfortunately. I don't imagine I will get a reply back from Apple if there is a resolution. My impression is generally it will end up in the patch notes if anything does happen. For the time being we have abandoned the flags and are using timeouts instead. Wish I had a better solution!
I had a reply from apple, have not been able to try it out myself:
"bug ID: 32357617
VPN causes issues with SCNetworkReachabilityFlags post 10.1.1
Please verify this issue with the iOS 11 beta and update your bug report at https://bugreport.apple.com/ with your results.
iOS 11 beta 3 (15A5318g) https://developer.apple.com/download/ Posted Date: July 10th, 2017
If the issue persists and it's applicable to your bug report, please attach a new sysdiagnose captured in the latest build and attach it to the bug report.
iOS sysdiagnose Instructions: https://developer.apple.com/services-account/download?path=/iOS/iOS_Logs/sysdiagnose_Logging_Instructions.pdf"
Not sure if they want us to be the QA on fixes too? haha.
@WesleyHunt Thank you very much for following up on this.
Hi, have anybody had a chance to test reachability + VPN + iOS 11 ?
Hey, just came here after having the same issues with iOS 11.0.3.
On 3G with a VPN connection and it returns Reachability.status as WiFi.
When I disconnect the VPN it returns wWAN which is what it should be.
Thanks
Slow on the update here as it was a lower priority for me but; same behaviour as Oliver mentioned, i'm in iOS 11.2.1. Now Reachability is always throwing the connected via WiFi flag. In my case the app is registered to the VPN so I can't ever simply disconnect the app from going through the VPN - as such even in airplane mode it doesn't change the flag from WiFi. So there's still something weird going on. The example project in this repo still works when when not using a VPN.
Any updates? Is there any workaround to this issue?
as of iOS 12.1 Reachability still reports as WiFi when on cellular VPN.
Hi, I noticed that when you do not subscribe to reachability notifications, then its connection status is not updated. To have a correct status without subscribing, you have to instantiate a new Reachability object each time.
Any updates on this?
as of iOS 17.0.3 Reachability still reports as WiFi when on cellular VPN.
In iOS 17.0.3 when I turned on VPN, I turned off the network and it still showed Wifi