tripflex / WifiWizard2

A Cordova plugin for managing Wifi networks (new version of WiFiWizard) - Latest is version 3+
https://www.npmjs.com/package/cordova-plugin-wifiwizard2
Apache License 2.0
122 stars 146 forks source link

Method "resetBindAll" improvements #102

Open cloudsurfers-it opened 4 years ago

cloudsurfers-it commented 4 years ago

Description of the Change

Now when call resetBindAll always force bindProcessToNetwork(null) without network connection connected ("desired" variable equal NULL).

Events such network receiver and network callback are correctly managed and unregistered before register new events. This fix try to avoid double invoking of the same event and cause problems when connecting to a network with bindAll parameter set to TRUE and subsequently disconnected.

Benefits

If you connect to a Wifi network without internet connection (bindAll parameter activated) and subsequently connect to a Wifi network with internet connection, second connection invoke bindProcessToNetwork(network) also without bindAll parameter. Now if you disconnect from network, resetBindAll don't work property and app doesn't access to mobile data connection for example.

Possible Drawbacks

From my tests and use case, nothing. I use this plugin to connect to a specific wifi network without internet connection and switching between different network configurations: mobile data, wifi with internet and wifi without internet access.

Applicable Issues

https://github.com/tripflex/WifiWizard2/issues/94

tripflex commented 3 years ago

@cloudsurfers-it thanks for submitting this, can anybody else validate if they have tested this at all?

siderisltd commented 3 years ago

@tripflex I need this fix, but I am not sure how to verify it works.