flutter_background_service
flutter_background_service copied to clipboard
background service not stopping
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());