Skip to content

Commit a92a4e7

Browse files
committed
docs: update readme
1 parent ea7db42 commit a92a4e7

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ The Dart Web package is limited in showing notifications, one can only show a ti
6666
Add the following to your `pubspec.yaml` file:
6767
```yaml
6868
dependencies:
69-
js_notifications: ^0.0.1
69+
js_notifications: ^0.0.3
7070
```
7171
7272
### Copy service worker
@@ -110,6 +110,10 @@ _jsNotificationsPlugin.showNotification('Title', {
110110
);
111111
```
112112

113+
_Note: the tag is used to identify the notification, if a notification with the same tag is shown, the previous notification is replaced.
114+
115+
For convenient notification access, provide a tag or one will be generated via the [uuid](https://pub.dev/packages/uuid) package, specifically `uuid.v4()`._
116+
113117
### Creating a notification with actions
114118

115119
Here, we use the `actions` parameter to add actions to the notification. These are filled with `JSNotificationAction` objects.
@@ -167,3 +171,24 @@ _jsNotificationsPlugin.dismissStream.listen((event) {
167171
print(event);
168172
});
169173
```
174+
175+
176+
### Get a list of all notifications
177+
```dart
178+
_jsNotificationsPlugin.getAllNotifications().then((notifications) {
179+
notifications.forEach((notification) {
180+
print(notification);
181+
});
182+
});
183+
```
184+
185+
### Get a specific notification
186+
```dart
187+
_jsNotificationsPlugin.getNotification('my-awesome-notification-tag-here').then((notification) {
188+
print(notification);
189+
});
190+
```
191+
192+
## Features and bugs
193+
194+
Any and all feedback, PRs are welcome.

0 commit comments

Comments
 (0)