cancelBackgroundTask method
Cancel a scheduled background task
Implementation
Future<void> cancelBackgroundTask(String taskId) async {
try {
await methodChannel
.invokeMethod<void>('cancelBackgroundTask', {'taskId': taskId});
} on PlatformException catch (e) {
throw MCPBackgroundExecutionException(
'Failed to cancel task: ${e.message}', e.details);
}
}