Potential fix for broken background task

This commit is contained in:
Neeraj Gupta 2022-10-15 12:25:03 +05:30
parent 30d5c39fcf
commit 3f89dc5c99
No known key found for this signature in database
GPG key ID: 3C5A1684DC1729E1

View file

@ -109,6 +109,8 @@ Future<void> _runInBackground(String taskId) async {
BackgroundFetch.finish(taskId);
}
// https://stackoverflow.com/a/73796478/546896
@pragma('vm:entry-point')
void _headlessTaskHandler(HeadlessTask task) {
if (task.timeout) {
BackgroundFetch.finish(task.taskId);