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

Android: crash/native error on connect if wifi disabled #7

Open
pstanton opened this issue Sep 24, 2018 · 2 comments
Open

Android: crash/native error on connect if wifi disabled #7

pstanton opened this issue Sep 24, 2018 · 2 comments

Comments

@pstanton
Copy link

pstanton commented Sep 24, 2018

it would be nice to include an "enable wifi" function, or at least an "is wifi enabled" function...

However, when executing connectToProtectedSSID with wifi disabled, I get the following exception:

"Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference"

connectTo RNWifiModule.java:261
connectToProtectedSSID RNWifiModule.java:186

@pstanton
Copy link
Author

#1 possibly related

@pstanton
Copy link
Author

pstanton commented Sep 24, 2018

gotta love undocumented features:

		try {
			WifiManager.isEnabled(function(enabled) {
				console.log("WiFi", "isEnabled", enabled);
			});
		} catch (e) {
			console.log("WiFi", "can't isEnabled", e);
		}

This is not available for IOS however.

@pstanton pstanton changed the title crash/native error on connect if wifi disabled Android: crash/native error on connect if wifi disabled Sep 24, 2018
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

1 participant