Cordova Network Manager enables Wifi management for both Android and iOS applications within Cordova/Phonegap projects.
iOS has limited functionality as Apple's WifiManager equivalent is only available as a private API. Any app that used these features would not be allowed on the app store.
Contact @arsenal942 via GitHub or discord at: Nomm#0176
These are functions that can be used by both Android and iOS applications
cordovaNetworkManager.getConnectedSSID(success, fail)
cordovaNetworkManager.getConnectedBSSID(success, fail)
For functionality, you need to note the following:
- Connect/Disconnect only works for iOS11+
- Can't run in the simulator so you need to attach an actual device when building with xCode
- Need to add the 'HotspotConfiguration' and 'NetworkExtensions' capabilities to your xCode project
cordovaNetworkManager.iOSConnectNetwork(ssid, ssidPassword, success, fail)
cordovaNetworkManager.iOSDisconnectNetwork(ssid, success, fail)
Based off the original WifiWizard however will undergo a rework.
cordovaNetworkManager.androidConnectNetwork(ssid, ssidToDisable, success, fail)
- 'ssidToDisable' is a parameter that tells the method what network we need to disable.
cordovaNetworkManager.androidDisconnectNetwork(ssid, ssidToEnable, success, fail)
- 'ssidToEnable' is a parameter that tells the method what network we need to enable. 'androidConnectNetwork' disables the devices current SSID to avoid the issue whereby Android OS just connects back to the already specified network.
cordovaNetworkManager.formatWifiConfig(ssid, password, algorithm)
cordovaNetworkManager.formatWPAConfig(ssid, password)
cordovaNetworkManager.addNetwork(wifi, success, fail)
cordovaNetworkManager.removeNetwork(wifi, success, fail)
cordovaNetworkManager.listNetworks(success, fail)
cordovaNetworkManager.startScan(success, fail)
cordovaNetworkManager.getScanResults([options], success, fail)
cordovaNetworkManager.isWifiEnabled(success, fail)
cordovaNetworkManager.setWifiEnabled(enabled, success, fail)
Run cordova plugin add https://github.com/arsenal942/Cordova-Network-Manager
This plugin is in active development. If you are wanting to have the latest and greatest stable version, then run the 'Releases' command below.
Run cordova plugin add cordovanetworkmanager@2.2.0
MIT