init static method

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

Initialize the FlutterForegroundTask.

Implementation

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