MethodChannelJsNotifications class

An implementation of JsNotificationsPlatform that uses method channels.

Inheritance
Implementers

Properties

actionStream Stream<NotificationActionResult>
Stream broadcasting notification click events with associated data & action
no setteroverride
dismissStream Stream<NotificationActionResult>
Stream broadcasting notification close events with associated data
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
hasPermissions bool
Convenience method checking browser notification support, wrapper for Dart's native JS notification Notification.permission
no setteroverride
isInitialized bool
Whether the service worker is registered and ready. See initialize.
no setterinherited
isSupported bool
Convenience method checking browser notification support, wrapper for dart's native JS notification Notification.supported
no setteroverride
methodChannel MethodChannel
The method channel used to interact with the native platform.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scopeUrl String
Updates the scope the plugin's service worker is registered under by re-registering the currently registered worker script (bundled or custom) with value as its scope. Fire-and-forget — prefer registerServiceWorker to await completion, register a custom worker script, or both.
no getterinherited
tapStream Stream<NotificationActionResult>
Stream broadcasting notification tap events with associated data
no setteroverride

Methods

addNotification(JSNotification notification) Future<void>
Send notification with interop.JSNotification to service worker
override
clearNotifications() Future<void>
Clear all notifications
override
dismissNotification({required String id}) Future<void>
Dismiss notification with ID
override
dispose() Future<void>
override
getAllNotifications() Future<List<JSNotification>>
Get all notifications
override
getNotification(String tag) Future<JSNotification?>
Get notification by tag
override
getNotificationTags() Future<List<String>>
Get all notification tags
override
getPlatformVersion() Future<String?>
override
initialize() Future<bool>
Completes when the plugin's service worker has been registered and its event listeners attached.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerServiceWorker({String? url, String? scope}) Future<void>
Re-registers the plugin's service worker with a custom url and/or scope, replacing the automatically registered bundled worker.
inherited
requestPermissions() Future<bool>
Convenience method checking browser notification support, wrapper for Dart's native JS notification Notification.requestPermission(). Returns true if response matches 'granted'.
override
sendAction(Map<String, dynamic> data, {String? id}) Future<void>
Send action to service worker
override
showNotification(String title, {List<JSNotificationAction>? actions, String? 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, List<int>? vibrate}) Future<void>
Send notification with customizable parameters to service worker
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited