Skip to content

Conversation

@tripflex
Copy link
Owner

@tripflex tripflex commented Jan 20, 2018

So after forking this repo and updating it, adding async methods, and testing on older devices (Android only so far), specifically Lollipop and Marshmello, I think the best way to move forward is to go ahead and refactor the majority of code base to fix issues found along the way.

  • Rename and switch to async promise based methods/functions
    It's 2018, if you're still using callbacks, maybe it's time to update your code base. To keep cleaner code base and easier for handling updates, and docs, going to move away from callbacks and only use promise async based functions

Refactoring

  • Refactor connect to automatically add network and then enable
    Because Android doesn't actually "connect" to networks, you just add the network config and then enable the wifi, i'm going to convert the connect method to automatically add/update the wifi configuration (without throwing errors if unable to update, or add), and as long as there's a valid network ID for the SSID, enable the network .. only throwing errors when connection fails, or no net id was able to be obtained

Oreo issues for modifying existing networks, enabling/disabling/removing networks now only allow the UID that created/added the network to remove/modify, etc.

Because of this, if you want to connect to a network (which code wise is done with enableNetwork), it must be done after adding the network configuration, as only the UID that created the configuration, and modify the state

Current Known Issues

  • Ping on bindall network does not work (assumption is due to using Runtime.getRuntime() but honestly not sure, don't know enough about Android to fix it at this time
    - The only reason I know this was while testing trying to ping router that does not have internet, and was unable to ... but running a standard HTTP GET request from JS worked fine ...

iOS

  • Test existing methods to make sure they still work
  • Update or remove any methods that no longer work

New Features

Connecting your App to a Wi-Fi Device
AnyDevice Example Code

cordova-plugin-network-information

  • Create separate classes and files to better organize all methods and classes
    After my initial fork of this plugin, things have been constantly growing and being added, resulting in a large single file with ~2k lines of code. Need to clean up code base, and move methods/functions/classes to separate files to keep clean codebase.

@tripflex tripflex added this to the Version 3.0.0 milestone Jan 20, 2018
@tripflex
Copy link
Owner Author

tripflex commented Feb 20, 2018

@tripflex tripflex merged commit 0d84cf6 into master Apr 12, 2018
ViggoChavine pushed a commit to ClevioAS/WifiWizard2 that referenced this pull request Oct 21, 2020
Add Cancel button and check wifi before showing alert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants