Skip to content
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

[Bug] Both loadWifiList() and reScanAndLoadWifiList() return empty list #53

Open
ithieund opened this issue Jul 4, 2018 · 6 comments
Open

Comments

@ithieund
Copy link

ithieund commented Jul 4, 2018

@devstepbcn ,
Can you please check why both loadWifiList() and reScanAndLoadWifiList() return empty list?
It happen in both AVD and Physical devices.

Here are some info:
"react": "16.0.0-alpha.12",
"react-native": "0.48.4",
"react-native-android-wifi": "0.0.31",

Code:

Wifi.reScanAndLoadWifiList((wifiStringList) => {
	console.log('Wifi list: ', wifiStringList);

	var networks = JSON.parse(wifiStringList);

	this.setState({
		loading: false,
		wifi: {
			...this.state.wifi,
			scanning: false,
			networks: networks
		}
	});
},
(error) => {
	console.log(error);
});

Log:
07-04 22:39:09.982 4560 4645 I ReactNativeJS: 'Wifi list: ', '[]'

@devstepbcn
Copy link
Owner

Hi @ithieund, have you request user permissions?
request permissions
Check issues #49, #47

Can you reproduce the bug with the app Example ?

@shihabus
Copy link

shihabus commented Jul 21, 2018

The wifiList is returning empty even after the permissions are granted. Previously it was working fine.

@santiblanko
Copy link

AndroidWifiModlue.reScanAndLoadWifiList got 1 arguments, expected 2
wifi.reScanAndLoadWifiList((wifiStringList) => {
var wifiArray = JSON.parse(wifiStringList);
console.log('Detected wifi networks - ',wifiArray);
});

@ghorbani-m
Copy link

Hi @shihabus
I had the same issue and then found if the android location is off the wifiList will be empty.

Turn location on for your device
Open your device's Settings app.
Tap Security & location.
If you don't see "Security & location," follow the steps for older Android versions.
If you have a work profile, tap Advanced.
Tap Location.
Turn Use location on .
https://support.google.com/accounts/answer/3467281?hl=en

@gregogalante
Copy link

I confirm the same bug that has @ghorbani-m . The list works property with the position active.

@verybluebot
Copy link

@ghorbani-m that worked for me too. wondering if there is a way to pop this to the user..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants