Is there a way to display all Wifi list in react native using expo for Android. I have seen a few libraries but mostly for android and even those don't work properly. Any suggestions?
I want like :
Is there a way to display all Wifi list in react native using expo for Android. I have seen a few libraries but mostly for android and even those don't work properly. Any suggestions?
I want like :
use this library and this the code give you (SSID) list
getWifiNetworksOnPress(){
wifi.loadWifiList((wifiStringList) => {
console.log(wifiStringList);
var wifiArray = JSON.parse(wifiStringList);
console.log(wifiArray);
},
(error) => {
console.log(error);
}
);
}
but in Android Api >25 you must be granted the ACCESS_COARSE_LOCATION (or ACCESS_FINE_LOCATION) permission in order to obtain results.
Just visit react-native-wifi-reborn.
Usage
import WifiManager from "react-native-wifi-reborn";
WifiManager.connectToProtectedSSID(ssid, password, isWep).then(
() => {
console.log("Connected successfully!");
},
() => {
console.log("Connection failed!");
}
);
WifiManager.getCurrentWifiSSID().then(
ssid => {
console.log("Your current connected wifi SSID is " + ssid);
},
() => {
console.log("Cannot get current SSID!");
}
);
I hope it will work.