react-native-network-info
react-native-network-info copied to clipboard
Android 9 always returns <unknown ssid>
On a Android device with version 9.0.0, the function NetworkInfo.getSSID()
always returns <unknown ssid>
The same code works without issues on a Android 8.x.x device
Is this a known bug?
You can add
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
to AndroidManifest.xml
,
and then you need to add
PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION);
,
maybe it can help you get correct ssid
You can add
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
toAndroidManifest.xml
, and then you need to addPermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION);
, maybe it can help you get correct ssid
I can confirm this works. it may related to Android 9's changes, you will need to request location permission to get wifi ssid.
You can add
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
toAndroidManifest.xml
, and then you need to addPermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION);
, maybe it can help you get correct ssidI can confirm this works. it may related to Android 9's changes, you will need to request location permission to get wifi ssid.
Agreed But with this you will also have to enable your location while using the application as only then will the data be loaded. Also I think this issue should be closed as it is more of a trouble with versions of Android and not this package