0

I am working on ibeacon and it is working perfectly fine when app is in foreground or when device is awake but app is in background. The issue is when device goes to sleep mode. iBeacon default methods gets stopped and start working as soon as device awakes. It does not matter whether app is in foreground or background.

I tried wake lock and alarm manager. But failed. Please suggest

Harneet Kaur
  • 4,487
  • 1
  • 16
  • 16
  • Did you tried to implement the logic in sticky background service ? – Faraz Ahmed Aug 18 '17 at 14:11
  • No, it is iBeacon and they are having there own SDK – Harneet Kaur Aug 18 '17 at 14:15
  • Yeah but they will respond when your activity is alive, you need to move the logic in background sticky service so it will remain alive and you will receive the info I had same problem and moved ibeacon code to service. – Faraz Ahmed Aug 18 '17 at 14:19
  • can you please share some reference code here ? – Harneet Kaur Aug 18 '17 at 14:20
  • read about services https://developer.android.com/reference/android/app/Service.html – Faraz Ahmed Aug 18 '17 at 14:28
  • No its not useful. Neither did enter not didExit methods are called in sleep mode – Harneet Kaur Aug 18 '17 at 14:44
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/152266/discussion-between-faraz-ahmed-and-harneet). – Faraz Ahmed Aug 18 '17 at 14:52
  • Beacon background support on Android all depends on the SDK you are using. I would suggest you check out the open source Android Beacon Library as it is designed to work in the background on many devices and OS versions. http://altbeacon.github.io/android-beacon-library/ (Full disclosure: I am the lead developer.) – davidgyoung Aug 18 '17 at 17:04
  • Using ibeacons, unable to add start monitoring regions () , BlueCatsSDKService is throwing exception as it is getting null context – Harneet Kaur Aug 19 '17 at 07:12

0 Answers0