3 Commits

Author SHA1 Message Date
soxa
44d3748d5f
fix: iOS PWA push notifications ()
* fix: iOS pwa push notifications

* fix lint

* align onNotificationClick promises to event.waitUntil

* align CLEAR_NOTIFICATIONS promises to event.waitUntil

* include notifications url for merged payloads

* hotfix: track amount via notification.length

* better comments

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2025-01-08 12:40:25 -06:00
SatsAllDay
a7b5534b7d
check both navigator.permissions.query and Notification.permission for permissions ()
it seems these values are not kept in sync on iOS Safari, which may be the source
of badges not working on iOS PWA
2023-11-25 11:32:41 -06:00
SatsAllDay
522c821c89
Notification badges ()
* First pass of implementing Badging API for notifications

* Only show app badge when driven from push notifications

* Display number of unread push notifications instead of just an empty badge

Clear badge via postMessage when notifications page is loaded

* de-dupe some code, update badge counter on each notification click

* remove ids, track open note count instead

* restore optional chaining

* ensure note count doesn't go below 0, and fix event.waitUntil error when clearing badge

* incorporate PR feedback
2023-11-08 18:17:01 -06:00