Reputation: 2736
I'm using Reachability to check for Wifi connectivity in my app.
When Wifi is available is it then possible to check what type of connectivity it is? e.g. I want to check if VPN is connected.
Upvotes: 0
Views: 1918
Reputation: 704
I have been looking for it too. though i have not managed to find any direct way but some guys online suggested these indirect methods. take a look if they might help!
use the BSD system call getifaddrs() to get a list of all network interfaces and then check whether anything that looks like VPN (e.g. utun0) is present.
If you know exactly to which VPN server users of your app will be connected then you can try to check what is current DNS server
You can get some flags for a current connection and connection changes in the reachability API. Most likely some combination of flags should let you know whether it's VPN or no.
Do update here if u try these out and they work! or if u find an easier way. :)
Upvotes: 4