How to use the react-native-wifi-reborn.getCurrentWifiSSID function in react-native-wifi-reborn

To help you get started, we’ve selected a few react-native-wifi-reborn examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github JuanSeBestia / react-native-wifi-reborn / example / RNWifiReborn / App.js View on Github external
const wifi = async () => {
    try {
      const data = await WifiManager.connectToProtectedSSID(
        ssid,
        password,
        isWep,
      );
      console.log('Connected successfully!', {data});
      setConneted({connected: true, ssid});
    } catch (error) {
      setConneted({connected: false, error: error.message});
      console.log('Connection failed!', {error});
    }

    try {
      const ssid = await WifiManager.getCurrentWifiSSID();
      setSsid(ssid);
      console.log('Your current connected wifi SSID is ' + ssid);
    } catch (error) {
      setSsid('Cannot get current SSID!' + error.message);
      console.log('Cannot get current SSID!', {error});
    }
  };
  useEffect(() => {

react-native-wifi-reborn

A react-native implementation for viewing and connecting to Wifi networks on Android and iOS devices.

ISC
Latest version published 3 months ago

Package Health Score

77 / 100
Full package analysis