Socket
Socket
Sign inDemoInstall

cordova-plugin-wificonnectionmanager

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.2 to 0.0.3

2

package.json
{
"name": "cordova-plugin-wificonnectionmanager",
"version": "0.0.2",
"version": "0.0.3",
"description": "WIFI settings and cofiguratiuons along with send user to WIFI settings page if not connected to particular WIFI",

@@ -5,0 +5,0 @@ "cordova": {

@@ -1,9 +0,10 @@

cordova-plugin-wificonnectionmanager
Cordova plugin for accessing Android WifiManager and wifi settings.
# cordova-plugin-wificonnectionmanager
## Cordova plugin for accessing Android WifiManager and wifi settings.
cordova plugin add cordova-plugin-wificonnectionmanager
Usage
### cordova plugin add cordova-plugin-wificonnectionmanager
## Usage
Access the plugin after the device is ready, exposed at window.cordova.plugins.WifiManager.
var WifiManager = cordova.plugins.WifiManager
var WifiManager = cordova.plugins.WIFIConnectionManager

@@ -24,6 +25,6 @@ WifiManager.onwifistatechanged = function (data) {

API
## API
All the exposed methods and events have matching WifiManager counterparts. The methods accept an optional callback as last argument, which is either called with an error object first, or with the value returned by the corresponding Java method.
addNetwork(wifiConfiguration, callback(err, netId))
### addNetwork(wifiConfiguration, callback(err, netId))
Add a new network to the set of configured networks.

@@ -80,15 +81,15 @@

disableNetwork(netId, callback(err, success))
### disableNetwork(netId, callback(err, success))
Disable a configured network.
disconnect(callback(err, success))
### disconnect(callback(err, success))
Disassociate from the currently active access point.
enableNetwork(netId, attemptConnect, callback(err, success))
### enableNetwork(netId, attemptConnect, callback(err, success))
Allow a previously configured network to be associated with.
getConfiguredNetworks(callback(err, wifiConfigurations))
### getConfiguredNetworks(callback(err, wifiConfigurations))
Get a list of all configured networks. The callback recevies a list of WifiConfiguration objects.
getConnectionInfo(callback(err, wifiInfo))
### getConnectionInfo(callback(err, wifiInfo))
Get information about the currently active WiFi connection. The callback receives a WifiInfo object.

@@ -112,3 +113,3 @@

getDhcpInfo(callback(err, dhcpInfo))
### getDhcpInfo(callback(err, dhcpInfo))
Get the assigned addresses from the last successfull DHCP request. The callback receives a DhcpInfo object.

@@ -127,3 +128,3 @@

}
getScanResults(callback(err, scanResults))
### getScanResults(callback(err, scanResults))
Get the results from the latest WiFi scan. The callback receives a list of ScanResult objects.

@@ -146,39 +147,39 @@

getWifiState(callback(err, wifiState))
### getWifiState(callback(err, wifiState))
Get WiFi enabled state. Possible values are DISABLED, DISABLING, ENABLED, ENABLING and UNKNOWN.
isScanAlwaysAvailable(callback(err, alwaysAvailable))
### isScanAlwaysAvailable(callback(err, alwaysAvailable))
Check if scanning is always available.
isWifiEnabled(callback(err, wifiEnabled))
### isWifiEnabled(callback(err, wifiEnabled))
Check if WiFi is either enabled or disabled.
reassociate(callback(err, success))
### reassociate(callback(err, success))
Reconnect to the currently active network, even if we already connected.
reconnect(callback(err, success))
### reconnect(callback(err, success))
Reconnect to the currently active network, if we are currently disconnected.
removeNetwork(netId, callback(err, success))
### removeNetwork(netId, callback(err, success))
Remove a configured network.
saveConfiguration(callback(err, success))
### saveConfiguration(callback(err, success))
Persist the current list of configured networks.
setWifiEnabled(enabled, callback(err, success))
### setWifiEnabled(enabled, callback(err, success))
Enable or disable WiFi.
startScan(callback(err, success))
### startScan(callback(err, success))
Request a scan for WiFi networks.
updateNetwork(wifiConfiguration, callback(err, netId))
### updateNetwork(wifiConfiguration, callback(err, netId))
Update an already configured network.
Events
## Events
The plugin also emits an event for each available broadcast intent action. The event callbacks are called with an object containing all the extra information from the intent.
onnetworkidschanged({})
### onnetworkidschanged({})
The IDs of the configured networks might have changed.
onnetworkstatechanged({ networkInfo, BSSID, wifiInfo })
### onnetworkstatechanged({ networkInfo, BSSID, wifiInfo })
WiFi connectivity changed. The callback receives a NetworkInfo object, a BSSID string and a WifiInfo object.

@@ -205,42 +206,42 @@

onrssichanged({ RSSI })
### onrssichanged({ RSSI })
Network signal strength changed.
onscanresultsavailable({ resultsUpdated })
### onscanresultsavailable({ resultsUpdated })
WiFi network scan completed. Results can be retrieved using the getScanResults method.
onsupplicantconnectionchange({ supplicantConnected })
### onsupplicantconnectionchange({ supplicantConnected })
Connection to the supplicant has been established or lost.
onsupplicantstatechanged({ newState, supplicantError })
### onsupplicantstatechanged({ newState, supplicantError })
The state of establishing a connection to a network has changed. newState contains the new SupplicantState value, and supplicantError indicates an error (e.g. ERROR_AUTHENTICATING).
onwifistatechanged({ wifiState, previousWifiState })
### onwifistatechanged({ wifiState, previousWifiState })
WiFi state changed.
onevent(name, data)
### onevent(name, data)
Called on all events with the event name (e.g. wifistatechanged) and extra information.
onerror
### onerror
Called on internal errors.
Hotspot
## Hotspot
The Android API does not expose a way to modify the hotspot configurations. But it is possible using reflection to access private and undocumented methods of the WifiManager instance. This approach is fragile and has some quirks, but has been tested to work with API version 23.
getWifiApConfiguration(callback(err, wifiConfiguration))
### getWifiApConfiguration(callback(err, wifiConfiguration))
Get the current WifiConfiguration object for the hotspot.
getWifiApState(callback(err, wifiApState))
### getWifiApState(callback(err, wifiApState))
Get WiFi access point state. Possible values are DISABLED, DISABLING, ENABLED, ENABLING and FAILED.
isWifiApEnabled(callback(err, wifiApEnabled))
### isWifiApEnabled(callback(err, wifiApEnabled))
Check if WiFi access point is either enabled or disabled.
setWifiApConfiguration(wifiConfiguration, callback(err, success))
### setWifiApConfiguration(wifiConfiguration, callback(err, success))
Set the WiFi access point configuration.
setWifiApEnabled(wifiConfiguration, enabled, callback(err, success))
### setWifiApEnabled(wifiConfiguration, enabled, callback(err, success))
Enable or disable WiFi access point with the given configuration.
onwifiapstatechanged({ wifiApState, previousWifiApState })
### onwifiapstatechanged({ wifiApState, previousWifiApState })
Event triggered when the WiFi access point state changes.
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