diff --git a/index.html b/index.html index 603265b..18810a6 100644 --- a/index.html +++ b/index.html @@ -392,14 +392,26 @@
app_badge
+ + A [=/64-bit unsigned integer=]. +
++ Platform conventions are likely to impose a lower limit with regards to what is + displayed to the end user. [[BADGING]] +
+mutable
A boolean. When true causes a push
event to be dispatched to a service
- worker (if any) containing the {{Notification}} object described by the
- declarative push message.
+ worker (if any) containing the {{Notification}} object and app badge number (if
+ any) described by the declarative push message.
A declarative push message parser result is a [=/tuple=] consisting of a notification (a - [=/notification=]) and a app + badge (null or an integer), and a mutable (a boolean).
@@ -673,6 +686,18 @@
+ Let appBadge be null. +
++ If message["`app_badge`"] [=map/exists=] and + message["`app_badge`"] is a [=/64-bit unsigned integer=], then set + appBadge to message["`app_badge`"]. +
+Let mutable be false. @@ -687,7 +712,7 @@
- Return (notification, mutable). + Return (notification, appBadge, mutable).
The notification attribute must return the value it was initialized with.
++ The appBadge attribute must return the value it was initialized with. +
+ Let |appBadgeSet| be false. +
+If |declarativeResult|'s [=declarative push message parser result/mutable=] @@ -1724,14 +1759,16 @@
Let |result| be the result of [=fire a push event|firing a push event=] - given |registration|, null, and a new {{Notification}} object - representing |notification|. + given |registration|, null, a new {{Notification}} object representing + |notification|, and |declarativeResult|'s [=declarative push message + parser result/app badge=].
If |result| is not failure, then set |notificationShown| to |result|'s - [=push event result/notification shown=]. + [=push event result/notification shown=] and |appBadgeSet| to |result|'s + [=push event result/app badge set=].
+ If |appBadgeSet| is false, then w3c/badging #111... +
+[=acknowledge a push message|Acknowledge=] the push message and abort @@ -1761,7 +1804,7 @@
Let |result| be the result of [=fire a push event|firing a push event=] given - |registration|, |data|, and null. + |registration|, |data|, null, and null.
- A push event result is a [=/tuple=] consisting of a notification shown (a [=/boolean=]). + A push event result is a [=/tuple=] consisting of a notification shown (a [=/boolean=]) and an app badge set (a [=/boolean=]).
To fire a push event given a [=/service worker registration=] |registration|, - {{PushMessageData}} object or null |data|, and a [=/notification=] or null - |notification|, run these steps. They return failure or a [=/push event result=]. + {{PushMessageData}} object or null |data|, a [=/notification=] or null |notification|, + and an integer or null |appBadge|, run these steps. They return failure or a [=/push + event result=].
+ Let |appBadgeResult| be null. +
+Set |registration|'s [=service worker registration/has shownotification() been @@ -1817,6 +1867,12 @@
Then run the following steps in parallel, with |dispatchedEvent|: @@ -1830,21 +1886,28 @@
- If they do not resolve successfully, then set |notificationResult| to failure. + If they do not resolve successfully, then set |notificationResult| and + |appBadgeResult| to failure and abort these steps. +
++ Set |notificationResult| to |registration|'s [=service worker registration/has + shownotification() been successfully invoked|has `showNotification()` been + successfully invoked=].
- 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.
- Wait for |notificationResult| to be non-null. + Wait for |notificationResult| and |appBadgeResult| to be non-null.
- [=/Assert=]: |notificationResult| is a [=/boolean=]. + [=/Assert=]: |notificationResult| and |appBadgeResult| are [=/booleans=].
- Return (|notificationResult|). + Return (|notificationResult|, |appBadgeResult|).