Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get wifi info on Android 13 #122

Open
zhenguet opened this issue Mar 6, 2023 · 1 comment
Open

Can't get wifi info on Android 13 #122

zhenguet opened this issue Mar 6, 2023 · 1 comment

Comments

@zhenguet
Copy link

zhenguet commented Mar 6, 2023

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"
    // }

    });
@labteam
Copy link

labteam commented Mar 20, 2023

Experience the same. I think it might be connected with new permissions on Android 13:
https://developer.android.com/about/versions/13/behavior-changes-13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants