Forum Xamarin.Forms

Detect VPN Connection

Is there any way within a Xamarin.Foms app to detect whether a user is on a VPN connection or not. For instance, I'm working an app that requires the user be connected to their enterprise VPN before they can use the app. I'd like to check for the VPN connection on startup and resume if possible, but I'm not sure if this can be done.

Answers

  • MichaelRumplerMichaelRumpler ATMember ✭✭✭✭✭

    You can use the Connectivity Plugin to ping an internal server. If that succeeds, then your either in the VPN or the internal network. No need to check for the VPN specifically.

  • @MichaelRumpler said:
    You can use the [Connectivity Plugin] "Connectivity Plugin") to ping an internal server. If that succeeds, then your either in the VPN or the internal network. No need to check for the VPN specifically.

    Had same question, don't know why I didn't think of this initially. Thanks!

Sign In or Register to comment.