Contact emails
Spec
https://w3c.github.io/push-api/#idl-def-PushSubscription
(minor update not worth TAG review)
Summary
An "options" attribute is added to the PushSubscription objects that the PushManager.subscribe(...) and getSubscription() promises resolve to. It reflects the options passed in by the author when the subscription was subscribed.
Motivation
This allows web developers to see what applicationServerKey each subscription is associated with, and hence what key their server will need to present when sending messages. Previously web developers with more than once applicationServerKey had to keep track of this separately (e.g. in IndexedDB).
Interoperability and risk
Firefox: The attribute was proposed by Mozilla, added to the spec, and they already shipped it in Firefox 48 beta. Currently they only implement the applicationServerKey attribute of the PushSubscriptionOptions interface, but omit the userVisibleOnly attribute, since Firefox ignores that flag.
Edge: No public signals Safari: No public signals Web developers: No signals
Compatibility risk
Zero - this just adds a new attribute and interface.
Ongoing technical constraints
None.
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes, except Android WebView which doesn't yet support the Push API.
OWP launch tracking bug
None. Implementation bug: https://crbug.com/626627
Link to entry on the feature dashboard
https://www.chromestatus.com/features/5678199010754560
Requesting approval to ship?
Yes.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
> I can't tell if calling getSubscription() immediately after subscribe() should always resolve with a PushSubscription object, always null, or if it's racy? Maybe a simpler design would be for getSubscription() to be sync and to say that it will start returning a non-null value right before the subscribe() promise is resolved?There's no real use case for calling getSubscription() immediately after subscribe(), since the subscribe promise is resolved with a PushSubscription object, same as getSubscription. getSubscription() is mainly used after a new page load, to find out whether the user is already subscribed; such a call needs to be async since the subscriptions are stored in the browser process (and we'd rather neither use a sync IPC nor slow down renderer startup by fetching the subscription then).To clarify though, PushSubscription objects have been shipped this way since m42 - this intent is just about adding the "options" attribute to them.