Comments (13)
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....
from wifiwizard2.
@klich3 @f18nfz @matscav @RolfDohrmann
some of the issues have been fixed in my forked repo:
https://github.com/EYALIN/community-cordova-plugin-wifi-wizard
you can install it as an npm package:
cordova plugin add community-cordova-plugin-wifi-wizard --save
from wifiwizard2.
@EduardSat i'm using it like this:
if (+this.device.version > 10) {
result = await (window as any).WifiWizard2.specifierConnection(wifiNetwork,wifiPassword, networkType, false);
} else {
result = await (window as any).WifiWizard2.connect(wifiNetwork, true,wifiPassword, networkType);
}
regarding the disable, i think it's deprecated from Android 12.
from wifiwizard2.
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!
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:
WifiWizard2.suggestConnection(SSID, pw, algorithm, isHidden).then( res => { console.log(res); }, err => { console.log(err); } );
I get back as res in the console:
STATUS_NETWORK_SUGGESTIONS_ADDED
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
from wifiwizard2.
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?
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().
from wifiwizard2.
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.
If I use the SSID of the currently connected network then I get this answer: DISCONNECT_NET_ID_NOT_FOUND
So I guess this DISCONNECT_NET_ID_NOT_FOUND
is the problem.
The documentation explains:
"Unable to determine network ID to disconnect/remove (from passed SSID)"
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:
UNABLE_TO_DISABLE
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?
from wifiwizard2.
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!
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).
(I get the message: Uncaught ReferenceError: enabled is not defined) or VERIFY_ERROR_ENABLE_WIFI
Does the function WifiWizard2.setWifiEnabled(enabled); work with devices running Android 10? Or is this currently impossible as per: https://issuetracker.google.com/issues/128554616?pli=1
Thanks!
from wifiwizard2.
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!
from wifiwizard2.
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. If I use the SSID of the currently connected network then I get this answer: DISCONNECT_NET_ID_NOT_FOUND
So I guess this
DISCONNECT_NET_ID_NOT_FOUND
is the problem.The documentation explains: "Unable to determine network ID to disconnect/remove (from passed SSID)"
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:
UNABLE_TO_DISABLE
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?
still a problem in 2023
from wifiwizard2.
@EYALIN
Hello! I'm trying to use your implementation with capacitor and ionic/react. Can yo uhelp with installing your library?
Trying to import your library to use functions from it: import { WifiWizard2 } from 'community-cordova-plugin-wifi-wizard'. Hovewer, i'm getting error: Cannot find module 'community-cordova-plugin-wifi-wizard' or its corresponding type declarations.
from wifiwizard2.
@EduardSat you cannot import it directly.
or you can use the ionic wrapper, or you can use windows.wifiwizard2 (not sure if it's there or inside window.plugins)
hope that in the future I will be able to make it strongly typed.
from wifiwizard2.
@EduardSat you cannot import it directly. or you can use the ionic wrapper, or you can use windows.wifiwizard2 (not sure if it's there or inside window.plugins)
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')
from wifiwizard2.
Related Issues (20)
- wifiWizard2.scan() returns error "Uncaught (in promise) SCAN_FAILED" HOT 3
- Is WifiWizard2 still maintained? HOT 6
- Android 10 ( 29 ) is not supported - Connect to network, enable, disable and more.. HOT 45
- Empty Array in com.apple.developer.networking.networkextension prevents Apple Upload HOT 8
- I have a working version running on Android 10. I modified it by forking https://github.com/ViggoChavine/WifiWizard2 who already started work for API 29 and i added on top of it for my app feel free to use as a base or as is: https://github.com/VijayVaveHealth/WifiWizard2/.
- Android - SDK android-targetSdkVersion <= 28 HOT 20
- Consulting for this package? HOT 3
- Android 8 will fail when the phone is the first time(new) connect to the wifi network from the app directly.
- Android 10: online/offline problems via wifi plugin HOT 1
- when will the new version that support android 10 be released? HOT 1
- Read saved wifi password
- Error: Plugin WifiWizard2 does not respond to method call add. Ensure plugin method exists and uses @objc in its declaration HOT 2
- ERROR_SETWIFIENABLED HOT 1
- Receive `null` from iOSConnectNetwork() when Cellular is enabled and Network is Saved HOT 2
- Unable to install the latest version of WifiWizard2 [Version 3.3.0] in Ionic Project
- Wifi with No Internet Disconnect after some time HOT 1
- internet access outside app
- How i connect to WIFI that requires username and passwoord?
- IOS 16 not get automatically SSID also not show subnet address and ipaddress
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wifiwizard2.