Android not finding any devices during scan while phone location is turned off #1192
RaphaelLeivas
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am posting this here in the hopes it may help someone, and perhaps suggest an improvent to the library.
In Android 10, the
scan
method will not find any devices if the phone location is turned off. No errors or warnings are thrown. After turning the phone location on again, thescan
method works as expected.It would be interesting to have a method
enableLocation
in the same way we currently haveenableBluetooth
, in order to prompt the user to manually turn the location on for thescan
to work. Throwing an error message if thescan
method is called while the phone location is turned off would also be very useful.Perhaps it is a bit obvious that the phone location must be turned on given the multiple location permissions we have to request for the Bluetooth to work. Nevertheless I lost a significant amount of time trying to make the scan work on my Android 10 phone after it worked perfectly on another Android 11 phone - the only difference was that the phone location was turned off on my Android 10 device. This would not have happened if the library had support to enable the phone location.
Having this in the documentation (for example, in the troubleshooting page) could also avoid this situation happening with other users in the future.
Beta Was this translation helpful? Give feedback.
All reactions