startBackgroundService method

  1. @override
Future<bool> startBackgroundService({
  1. required NotificationPayload payload,
  2. required ServiceType type,
})
override

Implementation

@override
Future<bool> startBackgroundService({
  required NotificationPayload payload,
  required ServiceType type,
}) async {
  if (await isBackgroundServiceRunning(type) == false) {
    return await methodChannel.invokeMethod(
      'startBackgroundService',
      {
        ...payload.toJson(),
        'type': type.name,
      },
    );
  }
  return false;
}