blackdeve / react-native-wifi

A react-native implementation for viewing and connecting to Wifi networks on Android and iOS devices.
76 stars 89 forks source link

connectToProtectedSSID fail to conect #12

Open jpdarveau opened 6 years ago

jpdarveau commented 6 years ago

I am trying to use the connectToProtectedSSID function and I always get the connection failed alert on my android phone.

I am able to get the wifi list, the current SSID, etc...

Could I be missing some configuration somewhere?

Is there a specific way to send the SSID and Password to the function?

I am using a Oneplus 6 phone and on Android 9

If you need more info, let me know.

Thanks

bntzio commented 5 years ago

Provide code snippets, please.

anton-shumanski commented 5 years ago

I have same problem. I use: react-native-cli: 2.0.1 react-native: 0.57.5 and test on samsung S8. The code is from the example:

let ssid = 'test'; let password = 'test'; WifiManager.connectToProtectedSSID(ssid, password, false) .then(() => { console.log('Connected successfully!') }, () => { console.log('Connection failed!') })

Every time the result is "Connection failed"

jnystrom commented 5 years ago

anybody have a solution here? I am also seeing this problem.

tosscaster commented 5 years ago

Android, In RNWifiModule.java, line 186

Maybe, this is bug connected = connectTo(result, password, ssid); ==> connected = connectTo(result, password, ssid); if (connected) { break; } <-- must be added

-> this may cause problems in some case

7laria commented 5 years ago

it happen to me on iOS