Open albertRCell opened 2 years ago
Thank you for this report.
This problem is largely a consequence of a setting shown in the question:
beaconManager.backgroundBetweenScanPeriod = 0
It probably also only happens if you set beaconManager.eneableScheduledScanJobs =false
because otherwise scanning would be auto restarted every 15-25 mins.
The reason is that when the background between scan period is 0, scanning never stops and also never restarts. If you turn off Bluetooth and turn it back on, that effectively kills the original scan. And because the library was told to never stop that original scan, it never detects again.
Clearly, this is not intended library behavioral — it is a bug. The library should register for Bluetooth off/ on events and restart scanning in the on event.
Until this is fixed, you can work around this by doing one of two things:
Thanks @davidgyoung I will try the work around
Expected behavior
Ranging should return beacons after phone's bluetooth is turned off and back on
Actual behavior
Scanner keeps running but beacons are not reported
Steps to reproduce this behavior
Mobile device model and OS version
Moto G Power 2021 Android 11
Android Beacon Library version
2.19.2
I opened a question in stackoerflow with more details on my config https://stackoverflow.com/questions/72552856/altbecon-ranging-stops-detecting-beacons-after-phones-bluetooth-is-turned-off-a
Thanks