Closed MagganKoolman closed 7 years ago
I was trying to run the example app on android 6.0 and did also receive an empty list. In my case, i had to add additional config lines to AndroidManifest.xml
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
as mentioned here
More than that, you need to ask for permissions in the Activity as well. The SO answer you referenced shows how to do that.
@joshuapinter is it enough doing this before calling BluetoothSerial.discoverUnpairedDevices()
?
const granted = await PermissionsAndroid.requestMultiple(
[
PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
PermissionsAndroid.PERMISSIONS.ACCESS_COARSE_LOCATION,
],
{
'title': 'Permission requested',
'message': 'Give it',
}
);
Or should it be implemented on the java part?
EDIT: damn, worked! :D thanks
@gabrielhpugliese Nice job and thanks for posting - good for everybody else landing here! 👍
I must have missed an essential part for this module. Whenever discoverUnpairDevices is called it returns an empty list. No error messages or warnings are thrown. I used the following code.