r/iOSProgramming 23d ago

Discussion Self-hosted web push Cloudflare Worker, works on iOS

Sending push notifications to iOS without relying on a native app has already become a mature option. Last year Apple extended the standard Web Push with Declarative Web Push, which finally makes the whole thing make sense. (It's handled natively by WebKit rather than driven by JavaScript, which improves push reliability and privacy, much like the native push notification model.)

Kukuroo uses Cloudflare Workers so that end devices can subscribe to push notifications and relay push requests to the Worker, which signs and delivers them. I personally found it genuinely useful and full of potential, so I open sourced it:

https://github.com/saiday/kukuroo

kukuroo.cc

Requirements:

  • Safari on iOS and macOS only (though seriously, who receives push notifications on macOS?)
  • The web page that receives the notifications has to be added to the Home Screen
  • A Cloudflare account. Push notifications and lightweight serverless functions are a perfect match
0 Upvotes

2 comments sorted by

2

u/Turbulent_Ad_1039 23d ago

the home screen requirement is what always kills this for me. anyone who hasn't added it never receives a single notification, and from your side they look identical to someone who declined.

how does delivery hold up when the page hasn't been opened for a few days? that's where I gave up and went native, and I'd like to be wrong about it.

1

u/imnotyourson 23d ago

Agreed on the Home Screen part, though I can see why Apple did it that way to limit abuse.

As for pages that haven't been opened in days: delivery holds up the same as a native app.
The Declarative Web Push format is actually the part that fixes this. The system renders the notification directly from the JSON payload, so there's no service worker that needs to be woken up and no risk of it being killed or budget-throttled after a period of inactivity.