react-native-network-info icon indicating copy to clipboard operation
react-native-network-info copied to clipboard

getBSSID is not working in android PIE

Open yusuf987 opened this issue 6 years ago • 6 comments

i am using "react-native-network-info": "^3.2.2", my react version is "react": "16.0.0-beta.5", "react-native": "0.49.3",

i am using react-native-network-info to get network BSSID this was wasworking fine untill my user update thier Android OS to Android PIE

it always return 02:00:00:00:01:00 in android PIE devices

anyone has any idea about this

yusuf987 avatar Nov 28 '18 07:11 yusuf987

Hello, In fact, the plugins is not working on Android 9. The ssid is <unkwown ssid>, Any ideas

bbourdel avatar Dec 05 '18 17:12 bbourdel

I don't have a current android device to try to reproduce the error but have you tried resetting your network settings on your device?

pusherman avatar Dec 05 '18 19:12 pusherman

Ok, I found some time to search this issue on Pie. The fact is, since Android Pie, the permission 'android.permission.ACCESS_COARSE_LOCATION' is need to have access to Wifi information.

As, I'm trying to solved it using https://facebook.github.io/react-native/docs/permissionsandroid. I will tell you as soon as finished to implem it.

Source : https://github.com/EspressifApp/EsptouchForAndroid/commit/f467e1ad4838bb924089c5e8c73bc9f9c08aba68

bbourdel avatar Jan 11 '19 12:01 bbourdel

I've tried to add ACCESS_COARSE_LOCATION permission but I still get an error for BSSID and SSID. Did you have success with it?

Joao-Leite avatar Feb 01 '19 15:02 Joao-Leite

This does fix the issue. Make sure to add it the the manifest as well as check runtime using PermissionAndroid.

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

westcode avatar Feb 20 '19 16:02 westcode

Also, you have to set your localisation active on your smartphone (turn GPS on).

bbourdel avatar Feb 22 '19 17:02 bbourdel