AltBeacon / android-beacon-library

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

One plus background not detecting beacons #1124

Closed Spectra6170 closed 1 year ago

Spectra6170 commented 1 year ago

One Plus devices not detecting any beacon device with ble when application is in background mode or closed.

davidgyoung commented 1 year ago

For background detections on OnePlus devices you must have the user disable battery optimization for your app as described here:

https://dontkillmyapp.com/oneplus

The recommended approach for apps is to detect a OnePlus device and instruct the user to perform those steps in order for the app for perform the background functions.

If you still have trouble after disabling battery optimization as described above, please test with the official reference app here: https://github.com/davidgyoung/android-beacon-library-reference-kotlin and attach a LogCat excerpt showing all system-level logs (not filtered for your application) for a 60 second + period where you:

  1. Ensure no beacons are transmitting and the reference app is not running
  2. Start a LogCat capture
  3. Launch the reference app
  4. Put the app to the background
  5. Turn on a beacon
  6. Wait 30 seconds