updateService method
Future<bool>
updateService({
- ForegroundTaskOptions? foregroundTaskOptions,
- String? notificationTitle,
- String? notificationText,
- Function? callback,
override
Implementation
@override
Future<bool> updateService({
ForegroundTaskOptions? foregroundTaskOptions,
String? notificationTitle,
String? notificationText,
Function? callback,
}) async {
if (await isRunningService) {
final options = <String, dynamic>{
'notificationContentTitle': notificationTitle,
'notificationContentText': notificationText,
if (foregroundTaskOptions != null) ...foregroundTaskOptions.toJson(),
};
if (callback != null) {
options['callbackHandle'] =
PluginUtilities.getCallbackHandle(callback)?.toRawHandle();
}
return await methodChannel.invokeMethod('updateService', options);
}
return false;
}