From 00c1f450c550609daedfc24667d2027a0a99b9b1 Mon Sep 17 00:00:00 2001 From: Matthew Fosse Date: Thu, 29 Aug 2024 17:58:07 -0400 Subject: [PATCH] save --- lib/entities/background_tasks.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/entities/background_tasks.dart b/lib/entities/background_tasks.dart index 3d90a6318..c16207a60 100644 --- a/lib/entities/background_tasks.dart +++ b/lib/entities/background_tasks.dart @@ -394,6 +394,14 @@ Future initializeService(FlutterBackgroundService bgService) async { ), ); + try { + bool isServiceRunning = await bgService.isRunning(); + if (isServiceRunning) { + print("Service is ALREADY running!"); + return; + } + } catch (_) {} + await bgService.configure( androidConfiguration: AndroidConfiguration( onStart: onStart,