Hacker News new | ask | show | jobs
by jakear 1117 days 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. There's a Dockerfile, currently deployed via fly.io.

2 comments

Timers requiring a connection to the internet are a non-starter IMO.
I 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.

I 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.
If I were on "People Who Only Are Willing To Use Built In Apps News" that would make sense.
Welcome to HN
I'd wager that this solution is definitely not in the "just works" department.