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

@marcoscaceres commented on this pull request.



> @@ -392,14 +392,26 @@ <h3>
                 </dd>
               </dl>
             </dd>
+            <dt>
+              <code>app_badge</code>
+            </dt>
+            <dd>
+              <p>
+                A [=/64-bit unsigned integer=].

> So you're saying that even platforms that do render a number, can also render just the badge without the number?

Correct. Android in particular supports both modes ("[App Icon can Show Badges with Numbers or Dot-style Badges](https://www.samsung.com/hk_en/support/mobile-devices/android-o-os-app-icon-can-show-badges-with-numbers-or-dot-style-badges/)"). Even though it's user controlled, a web developer can still just set a "dot" (i.e., what in the Badging spec is called a "flag"). 

> Bit finicky, I'll admit.

Yeah :( hopefully we can do it consistently across both specs. 

Possibly the most compatible option would be to change `app_badge` to support either a `boolean` or a `64-bit unsigned integer`: 

1. If app_badge is missing: do nothing.
2. If app_badge === true: then "flag.
3. Else if app_badge === false: "clear".
4. Else if typeof app_badge == "number", set number. 







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

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

Received on Wednesday, 10 September 2025 03:37:44 UTC