-
Notifications
You must be signed in to change notification settings - Fork 146
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
Version 3.3.0 for Android 10+ #127
Comments
Hello @matscav, I have an Ionic project. It works with capacitor. I was able to install your plugin and to call the suggestConnection() method. My hope was that it would connect my test device (Samsung A50, Android 11) to the chosen SSID. This is the code:
I get back as res in the console:
This is no error, which is great! However, the test device did not connect to the SSID. Is this the expected behaviour? What would I need to do to connect to the SSID? Btw, are you still a freelancer? The company in which I work is looking for a plugin developer. Drop me a note if you are interested. Regards, Rolf |
Ok, I assumed that suggestConnection() is a replacement for connect() which has to be used if Android >= 10. That was wrong. The connection works using a Samsung A50 / Android 11 when using the method specifierConnection(). |
Now I want to restore the original connection. My idea is that I use disconnect(). And then the Smartphone maybe reconnects to the original network. Using disconnect(): If I use no SSID then I get this answer: ERROR_DISCONNECT. So I guess this The documentation explains: So I tried getConnectedNetworkId(), which however gives me a result (e.g. 4) I tried the disable(). I first got the networkId by using getConnectedNetworkId(), then I call disable() using this networkId. The result is:
Documentation: "Android returned failure in disabling network". And I read: "Please note that most newer versions of Android will only allow you to disable networks created by your application" So what does it mean: "networks created by your application"? Does this mean that the app is able to connect to a network, but is not able to disconnect? |
Thanks, but I can't seem to enable WiFi (turn WiFi on) if it's off on Android 10 devices (or where I target SDK>=30 (I've tried your fork too). Thanks! |
Hello, I only added this function "suggestConnection". Maybe you can put some work on those functions that are not working and give it back to community. Regards! |
Hi "matscav" and "f18nfz", in my branch you have both connections one for oldes versions connect directly, and new one with suggest. The Suggest is for new gen Androids oldest one its not working properly because you need authorizations of user. I thing this project is died and not supported by creator.... |
still a problem in 2023 |
@klich3 @f18nfz @matscav @RolfDohrmann you can install it as an npm package: |
@EYALIN |
@EduardSat you cannot import it directly. hope that in the future I will be able to make it strongly typed. |
@EYALIN . i found the way to use your edited version. However, when i'm trying to connect to wifi using WifiWizard2.suggestConnection(), i'm always getting STATUS_NETWORK_SUGGESTIONS_ERROR. Can you suggest the way to solve that problem? And also i'm getting the error: DISABLE_NETWORK_NOT_FOUND, when i'm calling WifiWizard2.disable('ssid') |
@EduardSat i'm using it like this:
regarding the disable, i think it's deprecated from Android 12. |
while this might be somewhat late for you it might help others that stumble across this issue like I have. All the disconnect, delete and remove functions didn't work on API level 34, so I've taken EYALINs version and made two changes.
The plugin can be added like so: When I have the time I'll take a look at the suggest function to see if releaseNetwork will work there too. |
Hi all,
I just forked this pull request from @klich3: Pull Request
I made some fixes and I did create another function (suggestConnection) for the new API. You can read more here
If you want to test my code or you need to have this working, here is my repo: 3.3.0
Run
cordova plugin add https://github.com/matscav/WifiWizard2#dev
In Android 10+ all you have to do is call
WifiWizard2.suggestConnection(SSID, password, algorithm, isHiddenSSID)
instead ofWifiWizard2.connect(SSID, bindAll, password, algorithm, isHiddenSSID)
Hope this can help anyone!
The text was updated successfully, but these errors were encountered: