Same issue here. Very inconsistent behaviour, which we also hear from our users.
Our app starts in the background when it enters our Bluetooth beacon region and starts scanning. When the iPhone is right next to the device, it still finds zero peripherals sometimes. Our users also give this feedback, where on iOS 14 versions it worked near-100% of the time, where now it is very inconsistent.
So concretely, it doesn't call didDiscover peripheral
after using scanForPeripherals
. We give the service identifier of the device to the init of the CBCentralManager
via the CBCentralManagerOptionRestoreIdentifierKey
and also use that identifier as a parameter withServices
for the scanForPeripherals
method.
I've reproduced this locally a couple of times on iOS 15.1, where the scanning doesn't return anything for more than 20 seconds. Then, a couple of seconds after that, we get a trigger again didEnterRegion
and start scanning, which finds the same device within a couple of seconds.