Skip to content

Latest commit

 

History

History
33 lines (28 loc) · 720 Bytes

README.md

File metadata and controls

33 lines (28 loc) · 720 Bytes

Wifi control Phonegap plugin (Android Only)

1. Description

A plugin for turning Wifi on / off in Phonegap apps targeting Android devices.

2. Installation from GitHub

$ phonegap plugin add https://github.com/RyanJairam/wifi-control-phonegap-plugin

3. Usage

Add the CHANGE_WIFI_STATE permission to /platforms/Android/AndroidManifest.xml

<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />

Turn Wifi off

 window.WifiControlPlugin.setWifi('off', function(){ 
    // success
 },
 function(){
    // error
 });

Turn Wifi on

 window.WifiControlPlugin.setWifi('on', function(){ 
    // success
 },
 function(){
    // error
 });