andrey-ushakov / flutter_bluetooth_basic

Flutter plugin. Allows to find bluetooth devices & send raw bytes data
BSD 3-Clause "New" or "Revised" License
39 stars 141 forks source link

Does not scan bluetooth in android api 29 and 30 #16

Open andresperezmelo opened 4 years ago

andresperezmelo commented 4 years ago

The module is not able to scan bluetooth when compiling a project in targetSdkVersion 30 0 29 and compileSdkVersion 30 or 29

Works fine in api 28 or lower

Let's wait if the developer updates the package.

The problem

When compiled in api 29 or 30 the application is not able to request permanent location permission, only two options of

permission denied allow only with the app in use

And it turns out that the permission of only the app in use, your module is unable to scan bluetooth

Api 28 permission api 28 Api 28 app Api 28 buscar

Api 30 o 29 permission api 30

Doesn't scan in the app api 30 buscar

Let's hope they update it soon, if anyone knows of a similar package that works please let us know

Att: Andres Perez

mametjunior212 commented 4 years ago

me too

andresperezmelo commented 4 years ago

and created this for Android https://pub.dev/packages/print_bluetooth_thermal

ossgoossgo commented 3 years ago

I fix my project with android9. to android10 can not search bluetooth problem. All problems occur because android10 add new permission with bluetooth. Try to use this package permission_handler: ^5.0.1+1 https://pub.dev/packages/permission_handler

Before you call search bluetooth add these code Map<Permission, PermissionStatus> statuses = await [ Permission.location, Permission.locationWhenInUse, ].request(); print(statuses[Permission.location]); print(statuses[Permission.locationWhenInUse]);

Then call search ... It's work

Hope it can helps you