Skip to content

Can't get wifi info on Android 13 #122

@zhenguet

Description

@zhenguet

As title, I cant get Wifi info on android 13, it run nomally on android 12

    import {NetworkInfo} from 'react-native-network-info';

    NetworkInfo.getSSID().then(ssid => {
      setWifiSSID(ssid || '');

      console.log(ssid); 
      // 12: AndroidWifi
      // 13: <unknown ssid>
    });

@react-native-community/netinfo has the same issue. Has anyone to know the ways to fix it?

    import NetInfo from '@react-native-community/netinfo';

    NetInfo.fetch('wifi').then(state => {
      setWifiType(state.type);

      console.log(state);

    /**
    * Android 12
    */

    // {
    //   "details": {
    //     "bssid": "00:13:10:85:fe:01",
    //     "frequency": 2447,
    //     "ipAddress": "****",
    //     "isConnectionExpensive": false,
    //     "linkSpeed": 1,
    //     "rxLinkSpeed": 2,
    //     "ssid": "AndroidWifi",
    //     "strength": 99,
    //     "subnet": "255.255.255.0",
    //     "txLinkSpeed": 1
    //   },
    //   "isConnected": true,
    //   "isInternetReachable": true,
    //   "isWifiEnabled": true,
    //   "type": "wifi"
    // }

    /**
    * Android 13
    */

    // {
    //   "details": {
    //     "bssid": "02:00:00:00:00:00",
    //     "frequency": 5300,
    //     "ipAddress": "*****",
    //     "isConnectionExpensive": false,
    //     "linkSpeed": 300,
    //     "rxLinkSpeed": 300,
    //     "strength": 99,
    //     "subnet": "255.255.255.0",
    //     "txLinkSpeed": 300
    //   },
    //   "isConnected": true,
    //   "isInternetReachable": true,
    //   "isWifiEnabled": true,
    //   "type": "wifi"
    // }

    });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions