Comments (45)
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/.
For ViggoChavine you have to manually call the add and enable functions. I modified my connect function slightly so you can just do WifiWizard2.connect(wifi.SSID, false, wifi.password, 'WPA')
On Android 29 there is a bug on certain devices, so far i've seen it on Oneplus 6 and a Nokia android phone the connection dialog comes up and gets stuck in a loop. If you read stackoverflow or other websites users mention seeing this on some of their devices, there is also a google issue ticket that was started but no update so far, seems phone vendors are at fault here. It works fine on the Pixel and Samsung phones.
from wifiwizard2.
hi,
@VijayVaveHealth - after installing your version it seems like not working while trying to connect wifi.
I get a different error from what I had, but still can't connect. I get "CONNECT_FAILED_TIMEOUT"
from wifiwizard2.
@HusFNS That fork was really intended for a specific project I am working on but there's no reason it shouldn't work. I did have trouble getting that promise returned on success so I added a less than perfect workaround. Here's how I'm using in on > Android 10:
WifiWizard2.connect("SSID", true, "Password", "WPA").catch((e) => { if (e.toString() === "onUnavailable"){ // Failure (or user clicked cancelled) } WifiWizard2.getConnectedSSID().then((SSID) => { // Success }) });
I can confirm this works with Ionic 3 on a Pixel 4 with Android 11 - thanks!
from wifiwizard2.
I'm able to connect to networks now again thanks to @maxcodefaster's fork, thank you!
But is it correct the wi-fi doesn't automatically turn on anymore if it's turned off? Does anybody know if there is a way to still programatically turn on wi-fi?
from wifiwizard2.
@KinG-InFeT this was indeed what I said. That's why I used the workaround with the de timeout.
I see @maxcodefaster used my fix and made a merge request for the master branch.
from wifiwizard2.
I'm able to connect to networks now again thanks to @maxcodefaster's fork, thank you!
But is it correct the wi-fi doesn't automatically turn on anymore if it's turned off? Does anybody know if there is a way to still programatically turn on wi-fi?
How do you do it?
I'm doing it like this and I get WiFi not available
WifiWizard2.connect("myssid", true, "", "", false)
.then((data) => {
})
.catch(async (error) => {
});
from wifiwizard2.
Hello children for I have returned.
I have merged PR #115 (there needs to be one or two changes since I was a bit gun-hoe on the merge).
from wifiwizard2.
For me it helped setting "android-targetSdkVersion" to 28 and to manually enable GPS on the phone. Which seems to work as a workaround for now...
from wifiwizard2.
it will not work for you from November 2020.
from wifiwizard2.
@eliadAfeka i only call the WifiWizard2.connect and in my WifiWizard.js file you will see in the connect function the calls to the android code. Android 10 devices only call add and then don't do anything else.
`
if(device.platform === "Android" && parseInt(device.version.split('.')[0]) >= 10){
// New method for Android Q does not support it add method already brings up dialog to join network
} else {
// Successfully updated or added wifiConfig
cordova.exec(resolve, reject, "WifiWizard2", "connect", [WifiWizard2.formatWifiString(SSID), bindAll]);
}`
from wifiwizard2.
@VijayVaveHealth so I don't understand. how can I connect with Andoird>=10?
from wifiwizard2.
@VijayVaveHealth Thanks for the fix, it worked on Android 10 on my Samsung device.
There seems to be another issue, when i'm connected to other network and trying to connect to new network from the list, it's always saying "CONNECT_FAILED_TIMEOUT". It worked when i'm not connected to any wifi.
Should i disconnect before calling connect?
from wifiwizard2.
@laxman-spidey it turned to be that there is no support in WPA2, just use WPA instead and it will work.
from wifiwizard2.
@VijayVaveHealth can merge your commits?
from wifiwizard2.
@VijayVaveHealth your branch works perfect for me. This actually also gives me a succes back and doesn't keep hanging.
But actually it doesn't give me an error.
So when the network is not available it keeps loading any fix for this?
from wifiwizard2.
@VijayVaveHealth thanks for your work on implementing API level 29, unfortunately on Ionic 3 I receive a strange pop up saying "Searching for devices..." when I attempt to connect to a network via the connect or add method.
Eventually it will timeout giving me the option to cancel or retry. Interestingly, if I cancel, it reveals a pop up behind displaying my typical WiFiWizard2 connection message, but this never resolves.
This also happens with using the master branch of triplfex's repo which contains ViggoChavine's API 29 fixes (I have even tried other forks with API 29 support such as TMAEDCC, but I always have the same result).
I am using a Pixel 4 with Android 11.
from wifiwizard2.
I also saw that a few people started working on this but actually no success.
https://github.com/Pankaja13/WifiWizard2/tree/android-29 here the issue is it keeps looping and popping up the connection box.
https://github.com/ScottWaring/WifiWizard2/tree/android-ten-test This looked promising but when I add it to my project I get lots of errors so no succes
from wifiwizard2.
@HusFNS from what I can tell, almost all of the methods used in WifiWizard2 were deprecated. It seems that using WifiNetworkSuggestion might be the way forward now, but is only seems to support networks without an active internet connection (I assume it is intended purely for IoT).
Source: https://developer.android.com/guide/topics/connectivity/wifi-suggest#java
However, this may work in conjunction with above: https://developer.android.com/reference/android/provider/Settings?hl=en#ACTION_WIFI_ADD_NETWORKS
from wifiwizard2.
This plugin (https://github.com/sushichop/cordova-plugin-wifi-manager) does appear to work on my Pixel 4 running Android 11, however it does not have offer functionality such as scanning for nearby networks.
For now, I can run both plugins in order to achieve my goals, put perhaps the method used in cordova-plugin-wifi-manager can help with WifiWizard2's adoption of API level 29+.
from wifiwizard2.
@HusFNS That fork was really intended for a specific project I am working on but there's no reason it shouldn't work. I did have trouble getting that promise returned on success so I added a less than perfect workaround. Here's how I'm using in on > Android 10:
WifiWizard2.connect("SSID", true, "Password", "WPA").catch((e) => {
if (e.toString() === "onUnavailable"){
// Failure (or user clicked cancelled)
}
WifiWizard2.getConnectedSSID().then((SSID) => {
// Success
})
});
from wifiwizard2.
I have been working on a fix and can be tested. It works fine for me on my android 10 (samsung).
The reason why he doesn't always return onUnavailable is because it is a bug in android. I made a workaround with a timout.
The available now returns success
from wifiwizard2.
Hi, I was facing same issue on my device OnePlus 6T with Android 10 and i wasn't able to connect through selected ssid.
So after 2-3 days i got to know that you have to turn on your GPS before connecting to wifi network. And this method works for me Hopefully this will work for you as well.
from wifiwizard2.
possible android issue? https://issuetracker.google.com/issues/158344328
from wifiwizard2.
Yes MR is inspired by @HusFNS
from wifiwizard2.
yes, i use this commit
@KinG-InFeT this was indeed what I said. That's why I used the workaround with the de timeout.
I see @maxcodefaster used my fix and made a merge request for the master branch.
yes, i use the new fix with timeout but out UnAvailable, i tried add more timeout but not work. My device is Samsung Tab S6 Lite Android 10
from wifiwizard2.
I'm able to connect to networks now again thanks to @maxcodefaster's fork, thank you!
But is it correct the wi-fi doesn't automatically turn on anymore if it's turned off? Does anybody know if there is a way to still programatically turn on wi-fi?How do you do it?
I'm doing it like this and I get WiFi not availableWifiWizard2.connect("myssid", true, "", "", false) .then((data) => { }) .catch(async (error) => { });
yes, same error
from wifiwizard2.
the PR is #115
from wifiwizard2.
Like this @KinG-InFeT and @1x2x3x4x
WifiWizard2.connect(SSID, true, password, 'WPA').then((success) => {
...
}).catch((error) => {
...
});
from wifiwizard2.
Like this @KinG-InFeT and @1x2x3x4x
WifiWizard2.connect(SSID, true, password, 'WPA').then((success) => { ... }).catch((error) => { ... });
yes, this is my code
WifiWizard2.connect(ssid, true, password, algorithm, false).then(() => {
app.dialog.alert('Connessione riuscita');
}).catch((error) => {
console.warn(error);
app.dialog.close();
var errMsg = error && error.message ? error.message : error;
app.dialog.alert(errMsg);
});
(use framework7 latest version)
from wifiwizard2.
i found this project and work perfectly on my table with android 10: https://github.com/Tasssadar/RequestNetworkRepro but write in Kotlin
from wifiwizard2.
Did anyone encounter the following errors on Android 10?
I/WifiService: addOrUpdateNetwork not allowed for uid=10773
I/WifiService: getConfiguredNetworks not allowed for uid=10773
E/WifiService: 10164 has no permission about LOCAL_MAC_ADDRESS
https://github.com/sushichop/cordova-plugin-wifi-manager seems to work though, what could be the difference?
from wifiwizard2.
I've finally managed to get it to work like this on Android 10, Samsung s20 and a Samsung tablet. No luck on One Plus 5T but that's their fault, not the plugin's. I've used maxcodefaster's repo.
WifiWizard2.connect('mySSID', true, '', 'WPA').catch((e) => {
if (e.toString() === "onUnavailable") {
alert(e.toString())
}
WifiWizard2.getConnectedSSID().then((SSID) => {
alert(SSID)
})
});
However for some reason it won't work on a Xiaomi with Android 9.
from wifiwizard2.
I am having the same problem tried WifiWizard2.connect not working on Android 10 (APK-29), it is working fine on APK-28.
I am using Ionic 3 this is my implementation.
`declare var WifiWizard2: any;
WifiWizard2.connect("ssid", true, "password", "WPA").catch((e) => {
if (e.toString() === "onUnavailable"){
this.perror = e.toString();
// Failure (or user clicked cancelled)
}
WifiWizard2.getConnectedSSID().then((SSID) => {
// Success
this.pdone = JSON.stringify(SSID);
})
`
any help ?
from wifiwizard2.
I have the fine location permission also, but I can't grant background permission
this.androidPermissions.requestPermission(this.androidPermissions.PERMISSION.ACCESS_FINE_LOCATION);
from wifiwizard2.
it appears that my problem is with Ioinc 3 and android core as I understand if anyone could make it work or have a solution for that please let me know.
this is my project's android version
<engine name="android" spec="~7.1.4" />
this is the error while building
ifiWizard2.java:44: error: cannot find symbol import android.net.wifi.WifiNetworkSpecifier; ^
from wifiwizard2.
@arsenal942 I'm excited to see this finally merged, thank you!! π
I am wondering if changing the URL of the repository in package.json
and plugin.xml
(see https://github.com/tripflex/WifiWizard2/pull/115/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R13) is intended? π€
from wifiwizard2.
from wifiwizard2.
@xLarry I have fixed it
from wifiwizard2.
This has finally been merged and therefore can be closed :)
from wifiwizard2.
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/.
For ViggoChavine you have to manually call the add and enable functions. I modified my connect function slightly so you can just doWifiWizard2.connect(wifi.SSID, false, wifi.password, 'WPA')
On Android 29 there is a bug on certain devices, so far i've seen it on Oneplus 6 and a Nokia android phone the connection dialog comes up and gets stuck in a loop. If you read stackoverflow or other websites users mention seeing this on some of their devices, there is also a google issue ticket that was started but no update so far, seems phone vendors are at fault here. It works fine on the Pixel and Samsung phones.
I am having the same loop issue on Android 29 on my Oneplus 6t, it connects for a second and then disconnects again.
Any updates regarding this?
from wifiwizard2.
I am having the same loop issue on Android 29 on my Oneplus 6t, it connects for a second and then disconnects again.
Any updates regarding this?
That error has nothing to do with the plugin. It's your OS's fault. You can go and read about it on OnePlus'es forums.
Just google 'oneplus WifiNetworkSpecifier'.
You'll just have to wait and see if any future update from oneplus will fix it.
from wifiwizard2.
I'm able to connect to networks now again thanks to @maxcodefaster's fork, thank you!
But is it correct the wi-fi doesn't automatically turn on anymore if it's turned off? Does anybody know if there is a way to still programatically turn on wi-fi?How do you do it?
I'm doing it like this and I get WiFi not availableWifiWizard2.connect("myssid", true, "", "", false) .then((data) => { }) .catch(async (error) => { });
Did you find any solution for 'WiFi not available' ? I am getting the same error. I am currently using master branch on android 10.
from wifiwizard2.
Did you find any solution for 'WiFi not available' ? I am getting the same error. I am currently using master branch on android 10 OnePlus
from wifiwizard2.
I stoppped using this in my projects. I'm using Capacitor and works so far on the latst versions of Android and iOS: https://github.com/digaus/community-capacitor-wifi
from wifiwizard2.
So the solution is simply adding location permission to the app. You can ask for it from the app, or you can test it by going to your app settings -> permissions -> location and clicking
from wifiwizard2.
Related Issues (20)
- wifiWizard2.scan() returns error "Uncaught (in promise) SCAN_FAILED" HOT 3
- Is WifiWizard2 still maintained? HOT 6
- 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
- Version 3.3.0 for Android 10+ HOT 13
- 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.