AltBeacon / android-beacon-library

Allows Android apps to interact with BLE beacons
Apache License 2.0
2.83k stars 834 forks source link

Background mode or kill app scanning is not able to immediately detect a beacon #1050

Closed 906990152 closed 2 years ago

906990152 commented 2 years ago

Expected behavior

Background mode or kill app scanning is able to immediately detect a beacon

Actual behavior

background mode The beacon is detected only after a 15 minutes interval

Steps to reproduce this behavior

The background mode is ok, but the background mode is can't

Mobile device model and OS version

Honor V9 android 9

Android Beacon Library version

2.19

IMPORTANT: This forum is reserved for feature requests or reproducible bugs with the library itself. If you need help with using the library with your project, please open a new question on StackOverflow.com.

davidgyoung commented 2 years ago

It is expected that background detections on Android 8+ will typically take ~15 minutes. Thus blog post explains the tech limitations:

http://www.davidgyoungtech.com/2017/08/07/beacon-detection-with-android-8

Two alternatives for faster detections in the background with the library:

  1. Use a foreground service: https://altbeacon.github.io/android-beacon-library/foreground-service.html
  2. Use the intent scan strategy: https://github.com/AltBeacon/android-beacon-library/pull/1030