scheduleBackgroundTask method
Schedule a background task
Implementation
Future<void> scheduleBackgroundTask({
required String taskId,
required Duration delay,
Map<String, dynamic>? data,
}) async {
try {
await methodChannel.invokeMethod<void>('scheduleBackgroundTask', {
'taskId': taskId,
'delayMillis': delay.inMilliseconds,
'data': data,
});
} on PlatformException catch (e) {
throw MCPBackgroundExecutionException(
'Failed to schedule task: ${e.message}', e.details);
}
}