Has anyone managed to send a push notification from a Cloudflare Worker directly to APNS?

I’ve tried several times but have never succeeded. I don’t think Cloudflare Worker properly supports HTTP/2, which is required by APNS, but it’s baffling me, so I’m hoping someone has got it working.

@simonbs It's possible without a library, but have a look at something like "fivesheepco/cloudflare-apns2"

Though you're going to run into problems constantly opening and closing connections to APNS because of the short-lived nature of a worker request. It's not a problem at all small scale, but it is if you're sending frequent notifications.

Ideally you want a server sitting there maintaining a connection that fires off requests to APNS as they come in. There are also libraries for this.

@zachsimone It’s a good point that opening and closing connections could become a problem. I was hoping that I could somehow guarantee a worker to be alive for the duration of the call to APNS.