How can we help apps handle background events even if the app is closed?
Added the BackgroundTask class with its first method: beforeExit to execute a task before the app is terminated (if it enters the background). Mainly for iOS
@mlynch Hi, we have need for running a periodic and short-lived background task while an app is closed. The BackgroundTask docs state that such functionality is forthcoming; is this still the case? We'd be happy to knock it out if someone else is not already doing it. Any advice or known gotchas before we go down this path?
@mlynch @MattDHill I would also love this functionality, since this seems to be a very common use case. The existing Cordova plugin has many caveats and I've had trouble using it on many projects.
It's on my personal wish list for 2020. The big question is how we want it to work. Perhaps I should start by just putting down some thoughts into a doc and getting everyone's feedback
@mlynch That would be great. In my view, this is a major shortcoming right now, since many apps rely on background processing. One other thing that I'd like to be able to discuss in that document is the ability to access the internet while in background mode. Currently, normal HTTP calls do not work in background mode, since (I'm guessing) the webview is restricted. It would be great if there was a way to simply use the fetch api instead of relying on the Cordova advanced HTTP plugin to access the web while in background mode.
@mlynch We are going to get started on this right away, since it is something we need ASAP. Would you like to have a chat or call beforehand to sync on intended functionality or approach? If not, we will just move ahead.
I have this requirement as well. I don't even need HTTP or anything - just running some simple logic code and then triggering a local notification or updating the app icon badge.
@MattDHill @mlynch We also have this requirement. Where you able to start on this work, or do you have any guidance on how we should implement this?
Most helpful comment
@mlynch Hi, we have need for running a periodic and short-lived background task while an app is closed. The BackgroundTask docs state that such functionality is forthcoming; is this still the case? We'd be happy to knock it out if someone else is not already doing it. Any advice or known gotchas before we go down this path?