Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

altbeacon enforces 15 min backgroundBetweenScanPeriod on android 8+ #1198

Open
elican-doenyas opened this issue Jul 12, 2024 · 1 comment
Open

Comments

@elican-doenyas
Copy link

elican-doenyas commented Jul 12, 2024

Expected behavior

Library integrators should be able to configure custom values for the backgroundBetweenScanPeriod.

Actual behavior

The altbeacon library does not let the integrator change the value for backgroundBetweenScanPeriod and enforces 15 min between background scans. When a value less than 15 mins is given to this parameter, it warns with the following;

"Setting a short backgroundBetweenScanPeriod has no effect on Android 8+, which is limited to scanning every ~15 minutes"

and continues to wait for ~15 mins between every background scan.

Steps to reproduce this behavior

1- Set backgroundBetweenScanPeriod from beaconManager instance to any value below 15 mins, in milliseconds.
2- Observe the log: "Setting a short backgroundBetweenScanPeriod has no effect on Android 8+, which is limited to scanning every ~15 minutes"
3- Put the app on background.
4- Observe that the scan stops and does not start for the next ~15 mins. This can be identified by the lack of: "BluetoothLeScanner org.altbeacon.beaconreference Start Scan with callback"
message in the logcat, or by the lack of ble detections.

Mobile device model and OS version

Samsung S23(SM-S911B) - Android 14 / API 34

Android Beacon Library version

implementation 'org.altbeacon:android-beacon-library:2.20.3'

@allexandrucrisan
Copy link

@elican-doenyas can you retest using the latest beta version: [2.21.0-beta2]
This has fixed the issue for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants