3 ms·
Not ideal, but fairly easy to hand roll this with the new web push notification support. I support it as a component of a site I'm working on. The main annoyin
by jakear 3y ago
Not ideal, but fairly easy to hand roll this with the new web push notification support. I support it as a component of a site I'm working on.
The main annoying part is iOS PWA's kill their service workers when off screen even when explicitly told not to via the `waitUntil` command, so you need to have a server running which handles keeping track of the ongoing timeouts and calls the push notification endpoints accordingly.
Code for that is here, https://github.com/JacksonKearl/push-simple https://github.com/JacksonKearl/push-simple. There's a Dockerfile, currently deployed via fly.io.
- layer8 3y agoTimers requiring a connection to the internet are a non-starter IMO.
- jakear 3y agoI agree it sucks, but iOS's service worker policy gave me no other option. Every other browser is just fine having the timeout running in the background, and I in fact have both codepaths running simultaneously so any other browser can work offline. Funny that I provide a fully working code sample of how to do what the parent wants, explain the caveats associated with it, and get downvoted because Apple crippled their service workers... ok then, Hackers.
- hazebooth 3y agoWelcome to HN
- layer8 3y agoI think you’re getting downvoted because what you propose isn’t an adequate solution to what people find lacking in the iOS built-in apps. As you say, it sucks.
- jakear 3y agoIf I were on "People Who Only Are Willing To Use Built In Apps News" that would make sense.
- CaptainZapp 3y agoI'd wager that this solution is definitely not in the "just works" department.