Thank you! So if I understand this correctly one could poll for messages in the worker thread and notify the user without the need for a push provider? If so that is really fantastic and addresses my concerns.
-
-
To further my concerns a big factor for me with web notifs is the developer experience. Seems less than ideal that developers have to register projects with all the browser their users might be using. Its also an additional disadvantage to new browsers that lack marketshare.
1 reply 0 retweets 0 likes -
As I understand this, and I really may not, the way it's _meant_ to work is, the page says "do you want push notifications?", user says yes, browser API returns a push URL and token, page sends that to server, server hits the page URL with the token to send a notification, done.
2 replies 0 retweets 0 likes -
I'm guessing each browser has a consolidated socket that routes the push notifications for all the domains the user has accepted push notifications for - which is why the projects need to be registered by the publishers with each browser vendor. 1 socket = better battery life.
2 replies 0 retweets 1 like -
I don't _believe_ that's the case. AIUI (and again I may be wrong), Firefox listens to a Mozilla endpoint, sure, but the push notification API gives your client side js just a URL which you send to your server. Your server doesn't care where that URL is.
2 replies 0 retweets 0 likes -
Brock is right. The URL is for servers to route messages to the push provider, which then does last-mile over the consolidated socket.
1 reply 0 retweets 0 likes -
Agreed with that, but I don't think servers have to "register" at all, do they? They just get, for each user who wants push notifications, a URL/token for that user, and to send a push notification they send standard JSON to that URL. No registration required.
1 reply 0 retweets 0 likes -
If I'm not mistaken what Alex has just shown me is that alternatively you can have the user grant notification permission to the worker thread and the worker thread can poll any backend. This eliminates the need for project registration but you have to BYOB (backend).
2 replies 0 retweets 0 likes -
Also, you can't have the SW spun up if the page is closed. So Push Notifications do something unique (and better).
2 replies 0 retweets 0 likes -
So I understand, a SW can run in the background of an unfocused tab (which can send notifications w user permission) but that is not the same as an installed PWA? Is there any unique characteristic to an installed PWA (permission wise) other than an icon on the dashboard?
1 reply 0 retweets 0 likes
Uh, sort of. SWs can be started without *any* tab open (Push Notifications even work when Chrome is closed on Android). PWA installation is totally separable and doesn't grant the notification permission, tho both require a Service Worker as a background context.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
& Web Standards TL; Blink API OWNER
Named PWAs w/
DMs open. Tweets my own; press@google.com for official comms.