Socket
Socket
Sign inDemoInstall

cordova-plugin-vpn-detection

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cordova-plugin-vpn-detection

Developed for Ionic legacy app to detect if a VPN is open on the mobile device


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Cordova VPN Dectection

This Plugin works for both Android and iOS platform, and it is intended to be used for legacy Ionic 2,3 and 4 apps to detect active VPN on mobile devices, so it is tested on both platforms.

  • Node version 10.x
  • cordova ">=3.0.0"

Install

  • Run npm i cordova-plugin-vpn-detection
  • Run ionic cordova plugin add cordova-plugin-vpn-detection

Usage

Is VPN active on device

window.vpndetection.detectActiveVPN(successCallback, errorCallback)
  • => successCallback is called with true if VPN is active on device and returned param is a string ACTIVEVPN
  • => errorCallback is called if there was an error determining if a VPN is active and returned params is a string INACTIVEVPN

Example

  let successCallback = function (result) {
    let VPNIsActive = result == "ACTIVEVPN"
  };
  let errorCallback = function (failure) {
    console.log(failure)
  };

[!TIP] I would recommend to use the plugin by implementing the check in two different cases as below:
Make the check when app is initialized
Make the check when app status change from background to foreground, so that vpn check will be done even if user activated the VPN after launching the app.

Platform Support

iOS and Android.

License

MIT License

Mahmoud Bakhit © 2024


| / | | | | | | . . | __ | |_ _ __ ___ ___ _ _ | | | |/| |/ | '_ \| '_ _ \ / _ | | | |/ ` | | | | | (| | | | | | | | | | () | || | (| | _| |/_,|| ||| || ||_/ _,|_,|


| | | | | |
| |
__ | || |
_ _
| / ` | | ' | | | |
| || (
| | |
| | | | |
| |
_| _,|_|| ||_, |
__/ |
@ Email:

mahmoudfathy0@gmail.com

Keywords

FAQs

Last updated on 22 Jan 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc