AltBeacon / android-beacon-library

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

Notifications are not displayed on Android 14 in the background #1200

Open jirka-oone opened 2 months ago

jirka-oone commented 2 months ago

Expected behavior

notification is triggered

Actual behavior

notification not triggered when beacon is found

Steps to reproduce this behavior

I ran a test app [https://github.com/davidgyoung/android-beacon-library-reference-kotlin] - scanning beacon Eddystone. The app works fine in the foreground, the notification was displayed that it found the beacon in the nearby, but when I tried a similar steps in the background, the notification was not displayed. test on android 12, 13 was successful and without problems, do you know what could be wrong, thx

Mobile device model and OS version

test device: galaxy a14, android 14

Android Beacon Library version

8cd351f093bad282a03ef452c1baf4650aaff246 2.0-beta.6-624-g8cd351f

davidgyoung commented 11 hours ago

Did you really use the library version from this commit? https://github.com/AltBeacon/android-beacon-library/commit/8cd351f093bad282a03ef452c1baf4650aaff246

That library code is from 7 years before Android 14 was released so there is no way it will work to detect beacons in the background on Android 14. You must use a much newer library version. The latest is 2.21.0-beta3 which has specific fixes for Android 14.