showNotification method
Future<void>
showNotification(
- String title, {
- List<
JSNotificationAction> ? actions, - int? badge,
- String? body,
- Map<
String, dynamic> ? data, - JSNotificationDirection? dir,
- String? icon,
- String? image,
- String? lang,
- bool? renotify,
- bool? requireInteraction,
- bool? silent,
- String? tag,
- int? timestamp,
- VibratePattern? vibrate,
override
Send notification with customizable parameters to service worker
Implementation
@override
Future<void> showNotification(
String title, {
List<interop.JSNotificationAction>? actions,
int? badge,
String? body,
Map<String, dynamic>? data,
interop.JSNotificationDirection? dir,
String? icon,
String? image,
String? lang,
bool? renotify,
bool? requireInteraction,
bool? silent,
String? tag,
int? timestamp,
web.VibratePattern? vibrate,
}) {
final options = interop.JSNotificationOptions(
actions: actions,
badge: badge,
body: body,
data: data,
dir: dir,
icon: icon,
image: image,
lang: lang,
renotify: renotify,
requireInteraction: requireInteraction,
silent: silent,
tag: tag,
timestamp: timestamp,
vibrate: vibrate,
);
final notification = interop.JSNotification(title, options);
return serviceWorkerManager.postNotification(notification);
}