showNotification method

  1. @override
Future<void> showNotification(
  1. String title, {
  2. List<JSNotificationAction>? actions,
  3. int? badge,
  4. String? body,
  5. Map<String, dynamic>? data,
  6. JSNotificationDirection? dir,
  7. String? icon,
  8. String? image,
  9. String? lang,
  10. bool? renotify,
  11. bool? requireInteraction,
  12. bool? silent,
  13. String? tag,
  14. int? timestamp,
  15. 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);
}