Skip to content

tmrpj/cordova-plugin-wifi-manager

 
 

Repository files navigation

cordova-plugin-wifi-manager

GitHub license npm version GitHub Actions CircleCI Travis js-semistandard-style

Wi-Fi Manager Plugin for Apache Cordova

Supported Platforms

  • Android: 5.0 or later
  • iOS: 10.0 or later

Installation

cordova plugin add cordova-plugin-wifi-manager

Usage

Connect to Wi-Fi access point

document.addEventListener('deviceready', onDeviceReady, false);

function onDeviceReady () {
  window.wifiManager.connect(
    'TARGET_SSID',
    'TARGET_PASSPHRASE',
    function (ssid, passphrase) {
      console.log('Successful. ssid: ' + ssid + ', passphrase: ' + passphrase);
    },
    function (code, message) {
      console.log('Failed. code: ' + code + ', message: ' + message);
    }
  );
}

Disconnect from Wi-Fi access point

document.addEventListener('deviceready', onDeviceReady, false);

function onDeviceReady () {  
  window.wifiManager.disconnect(
    'TARGET_SSID',
    function (ssid) {
      console.log('Successful. ssid: ' + ssid);
    },
    function (code, message) {
      console.log('Failed. code: ' + code + ', message: ' + message);
    }
  );
}

License

cordova-plugin-wifi-manager is available under the MIT license. See the LICENSE file for details.

About

Wi-Fi Manager Plugin for Apache Cordova

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 43.1%
  • Objective-C 31.4%
  • JavaScript 25.5%