devstepbcn / react-native-android-wifi

A react-native module for viewing and connecting to Wifi networks on Android devices.
ISC License
212 stars 121 forks source link

forceWifiUsage not working #82

Open Pankajmalhan opened 5 years ago

Pankajmalhan commented 5 years ago

I am working on a project in which we connect to a Raspberry PI device. This PI device makes a hotspot and we make a connection to PI using WIFI. If Mobile data is off then all APIs request are sent to WIFI but if mobile data is on then APIs request doesn't redirect to wifi instead request are send to Mobile data. I try forceWifiUsage method but that is not also working. wifi.forceWifiUsage(true); wifi.findAndConnect(FlyDetect-${this.props.navigation.state.params.deviceSerial.substr(11)}, API.pIDevicePassword, (found) => { if (found) { this.checkConnection(); } else { alert(strings("errorMessages.CT1008", this.lang)) } });

wifi.connectionStatusOfBoundNetwork((isBound) => { if (isBound) { this.getConfig(); } else { alert('no'); this.checkConnection(); } });

after implementing this all request are going to mobile data, instead of wifi. What am I doing wrong ?

jothikannan commented 5 years ago

I am also getting the same issue

jothikannan commented 5 years ago

@Pankajmalhan, please try #85

pjunior94 commented 4 years ago

@jothikannan even trying what you did in #85. I also getting the same issue. On debug it works perfectly, not the same after release the app.

verybluebot commented 4 years ago

same on Android 10