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

Android 14 - Samsung devices not detecting beacons in background #161

Open
ecitulsky-ims opened this issue Sep 25, 2024 · 1 comment
Open
Labels
question Further information is requested

Comments

@ecitulsky-ims
Copy link

When the app is in the background, and a beacon comes into range, app does not receive notification that beacon is present. The beacon can be around for quite a bit of time with no detection.

If I open up the system settings and navigate to BT menu, I can see the beacon. As soon as this happens, the app receives the notification the beacon is present. The Nordic Scanner library does not seem to be performing scans in the background at all.

NOTE: We have tested this on quite a few devices. It is most prevalent on Samsung but does occasionally occur on Pixel phones as well.

@philips77
Copy link
Member

Hello,

Whether your app can scan in the background depends on the filter. It has to be set and can't be empty. Otherwise, the scanning can be downgraded to opportunistic, meaning that you'll get a result if some other app is actively scanning.

The Nordic Scanner library

I'm not sure which library are you referring. This one? The scanner API allows to set a filter here:

fun scan(
filters: List<BleScanFilter> = emptyList(),
settings: BleScannerSettings = BleScannerSettings(),
): Flow<BleScanResult> = callbackFlow {

Note

I'm working on a new version of this library (Kotlin BLE Library). An early alpha version is available on version/2.0 branch, but API is far from stable.

@philips77 philips77 added the question Further information is requested label Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants