Re: [w3c/push-api] Add app badge to Declarative Web Push (PR #402)

@annevk commented on this pull request.



>                  </p>
               </li>
               <li>
                 <p>
-                  Otherwise, set |notificationResult| to |registration|'s [=service worker
-                  registration/has shownotification() been successfully invoked|has
-                  `showNotification()` been successfully invoked=].
+                  Set |appBadgeResult| to true if {{NavigatorBadge/setAppBadge()}} has been
+                  invoked; otherwise false.

No, this is specifically to catch the case where the developer used `setAppBadge()` (and maybe even `clearAppBadge()`, come to think of it) and so we don't want to use the declarative app badge result.

See https://notifications.spec.whatwg.org/#service-worker-registration-has-shownotification-been-successfully-invoked and how `showNotification()` ends up setting it to true. (We set it to false here first before dispatching the event to the service worker.) We need the same for app badge.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/push-api/pull/402#discussion_r2335834452
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/push-api/pull/402/review/3204833030@github.com>

Received on Wednesday, 10 September 2025 07:31:35 UTC