startService method

  1. @override
Future<void> startService({
  1. required String name,
  2. required String notificationTitle,
  3. required String notificationBody,
  4. String? notificationIconName,
  5. int notificationId = 1001,
  6. int? updateIntervalMs,
})

Starts a persistent background service with foreground notification.

Implementation

@override
Future<void> startService({
  required String name,
  required String notificationTitle,
  required String notificationBody,
  String? notificationIconName,
  int notificationId = 1001,
  int? updateIntervalMs,
}) async {
  await methodChannel.invokeMethod('startService', {
    'name': name,
    'notificationTitle': notificationTitle,
    'notificationBody': notificationBody,
    'notificationIconName': notificationIconName,
    'notificationId': notificationId,
    'updateIntervalMs': updateIntervalMs,
  });
}