init static method

Future<void> init({
  1. required AndroidNotificationOptions androidNotificationOptions,
  2. required IOSNotificationOptions iosNotificationOptions,
  3. ForegroundTaskOptions? foregroundTaskOptions,
  4. bool? printDevLog,
})

Initialize the FlutterForegroundTask.

Implementation

static Future<void> init({
  required AndroidNotificationOptions androidNotificationOptions,
  required IOSNotificationOptions iosNotificationOptions,
  ForegroundTaskOptions? foregroundTaskOptions,
  bool? printDevLog,
}) async {
  _androidNotificationOptions = androidNotificationOptions;
  _iosNotificationOptions = iosNotificationOptions;
  _foregroundTaskOptions = foregroundTaskOptions ??
      _foregroundTaskOptions ?? const ForegroundTaskOptions();
  _printDevLog = printDevLog ?? _printDevLog;
}