startService static method
Start the foreground service with notification.
Implementation
static Future<bool> startService({
required String notificationTitle,
required String notificationText,
Function? callback,
}) async {
if (_initialized == false) {
throw const ForegroundTaskException(
'Not initialized. Please call this function after calling the init function.');
}
return await FlutterForegroundTaskPlatform.instance.startService(
androidNotificationOptions: _androidNotificationOptions,
iosNotificationOptions: _iosNotificationOptions,
foregroundTaskOptions: _foregroundTaskOptions,
notificationTitle: notificationTitle,
notificationText: notificationText,
callback: callback,
);
}