cordova-plugin-ibeacon icon indicating copy to clipboard operation
cordova-plugin-ibeacon copied to clipboard

Monitoring in background mode - Android

Open RikdeVos opened this issue 8 years ago • 3 comments

I'm using this plugin to monitor a couple of ibeacons, and it works great in background mode on iOS (even after killing the app!). But on Android I'm having no luck. After leaving it closed for a while Android seems to kill the app and stop monitoring.

I don't want to use katzer's background mode plugin as that always displays a notification, and when turning off that notification Android still kills the app.

Has anyone solved this issue?

RikdeVos avatar Dec 16 '16 09:12 RikdeVos

I could not solve this issue with this plugin because background monitoring does not spawn a webview in which the javascript callback can be executed. I had to create a plugin that registered a sticky service in which all relevant functionality was natively executed. I then used a javascript interface to start and configure the service when the app ran.

mpk2 avatar Jan 18 '17 19:01 mpk2

mpk2 do you have an example of that plugin that you could share?

halindrome avatar Mar 21 '17 12:03 halindrome

@halindrome Sure, although it's somewhat specific. Hopefully you'll be able to modify it for your needs:

https://github.com/Topl/cordova-beacon-background

mpk2 avatar Mar 21 '17 19:03 mpk2