-
Notifications
You must be signed in to change notification settings - Fork 146
Complete refactoring and move to version 3.0.0 #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 tasks
7 tasks
Owner
Author
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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
connectto automaticallyaddnetwork and then enableBecause Android doesn't actually "connect" to networks, you just add the network config and then enable the wifi, i'm going to convert the
connectmethod 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 obtainedOreo 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 stateCurrent Known Issues
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
New Features
Add permissions handling, specifically
ACCESS_FINE_LOCATIONto prevent requiring GPS enabledAdd
bindAllargument toenableandconnectto setbindProcessToNetworkorsetProcessDefaultNetworkto route all connections from application through wifi (regardless of whether wifi has internet)Add helper method to get wifi signal strength https://github.com/devstepbcn/react-native-android-wifi/blob/master/android/src/main/java/com/devstepbcn/wifi/AndroidWifiModule.java#L319
Connecting your App to a Wi-Fi Device
AnyDevice Example Code
Possible integrate discontinued features from hotspot plugin Request for merging other discontinued libraries into WifiWizard2 #4
Add methods to obtain IP address and other network information cordova-plugin-networkinterface
Add method to check for internet access
isConnectedToInternetcordova-plugin-network-information
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.