cordova-plugin-foreground-service icon indicating copy to clipboard operation
cordova-plugin-foreground-service copied to clipboard

How to use with capacitor-community/bluetooth-le

Open aanders77 opened this issue 2 years ago • 1 comments

I need to upload firmware to a satellite antenna via Bluetooth LE. For that I'm using https://github.com/capacitor-community/bluetooth-le. The upload takes close to an hour. Obviously, I need to make sure that the upload continues if the app is moved to background or screen is turned off.

I'm struggling to understand the relation between this plugin and the needed background service. Is the bluetooth LE plugin a background service in itself, or would I need an additional service? Can you please give an example in pseudo code to guide me in the right direction? I would be happy to pay for a good example.

aanders77 avatar Sep 11 '22 18:09 aanders77

The purpose of this plugin is to show a foreground notification to let Android know that the app has a foreground process (so that it does not close your app when inactive / doze). That in itself does not keep your code running in the background. You need another plugin to actually maintain your background process as well (something like this plugin). I have not used the plugin you are referring to, but I don't see much mention of background processing.

DavidBriglio avatar Mar 02 '23 03:03 DavidBriglio