flutter_background_service icon indicating copy to clipboard operation
flutter_background_service copied to clipboard

background service not stopping

Open Jeyanthinath opened this issue 3 years ago • 0 comments

I can able to successfully start the bg service, but I tried stopping in many ways its not stopping

platform : IOS (emulator)

// init
var service = null;
ActivityMap() {
  WidgetsFlutterBinding.ensureInitialized();
  service = FlutterBackgroundService();
  service.setForegroundMode(false);
}
.
.
.
.
// cancelling in some other function inside the same class
void cancelBg(){
  service.stopBackgroundService();
  service.sendData({"action": "stopService"});
  
  FlutterBackgroundService().stopBackgroundService();
  FlutterBackgroundService().sendData({"action": "stopService"});
}

still the below print giving true

var isRunning = await service.isServiceRunning();
print("status: " + isRunning.toString());

Jeyanthinath avatar Aug 24 '21 19:08 Jeyanthinath