-
Notifications
You must be signed in to change notification settings - Fork 128
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
Android functions providing empty responses #9
Comments
What could you see on the console ?, did I get an error? |
getCurrentWifiSSID logs
connectToProtectedSSID logs
loadWifiList logs
|
The current code requires location permission. It can't scan for wifi networks or connect to one starting Android 6 without it. |
I am willing to look into making this more clear:
@JuanSeBestia can you assign me to this? |
Thank you @eliaslecomte! I've implemented a permissions request with PermissionsAndroid for ACCESS_FINE_LOCATION and the loadWifiList and getCurrentWifiSSID functions are now working. However, I still can't get the connectToProtected SSID function to work. I'm getting the following error now:
I'm going to dig into this a bit more, but any thoughts are much appreciated. |
Hey @jkaravakis. Even ACCESS_COARSE_LOCATION should do the trick. There is corrently a bug in the connect logic on line 213 and + of RNWifiModule.java
This is not correct. This is fixed in our fork https://github.com/inthepocket/react-native-wifi-reborn and there is a PR open. Waiting for @JuanSeBestia to publish it :-). |
@eliaslecomte you are awesome! I can confirm it works using your fork. Much appreciated! FYI regarding coarse access, that did not seem to work for me. |
I'm having same problems with @jkaravakis and even after defining ACCESS_FINE_LOCATION nothing worked for me. my logs are same as well, also I don't know how to get @eliaslecomte 's fork 😞 |
Hi @mferhatkeles, I had to use PermissionsAndroid.request to get location permission from the user. Documentation can be founder here: https://facebook.github.io/react-native/docs/permissionsandroid Essentially you want to run the below function:
Hope this helps! |
hello @jkaravakis async function requestAccess() { this is my function to get it and I can get granted every time. but wifi functions do not work. did you totally fix your problem? can you use connectToProtectedSSID ? |
@mferhatkeles I don't see anything wrong with your code, have your tried nesting connecToProtectedSSID within if (granted === PermissionsAndroid.RESULTS.GRANTED)? This structure is working for me. |
@jkaravakis ı just tried this and nothing happened 😞 |
@mferhatkeles there is a problem currently with the connecToProtectedSSID on some Android versions. Can you get the list wifi networks to work? |
@eliaslecomte yes I added the permission to android manifest still does not work. Still I might have problem with permission tho. Where should ı call permission function? |
v2.2.2 is Released! |
v2.2.2 seems to have addressed the original issue. Many thanks to @eliaslecomte for the excellent work! |
I have successfully implemented react-native-wifi-reborn into my app, but none of the functions are responding properly on Android.
For example getCurrentWifiSSID is giving the following logged response "Your current connected wifi SSID is "
connectToProtectedSSID is catching a failure, and loadWifiList is succeeding but returning an empty array.
I am using React Native 0.61.2, and did not link. Do I need to manually request WiFi permissions from the user?
Thank you!
The text was updated successfully, but these errors were encountered: