// the find
kylebrowning/APNSwift
📱HTTP/2 Apple Push Notification Service built with swift - send push notifications to iOS, iPadOS, tvOS, macOS, watchOS, visionOS, and Safari!
APNSwift is a server-side Swift library for sending Apple Push Notifications over HTTP/2, built on AsyncHTTPClient and SwiftNIO. It's for Swift backend developers who need to push to any Apple platform without shelling out to a third-party service. It's an SSWG graduated project, which means it's gone through real community review.
The type system does real work here — each notification type (alert, background, VoIP, Live Activity, complication, Push to Talk) has its own struct with only the fields that apply, so you can't accidentally send an alert payload to a VoIP endpoint. Live Activity support (start/update/end) is first-class and matches Apple's 2023+ API surface. There's a URLSession-based client alongside the NIO one, which matters if you're on a platform where NIO is overkill or restricted. The included APNSTestServer target lets you validate your notification structure locally without hitting Apple's sandbox.
The JWT auth setup requires you to pre-convert your .p8 key to PEM format manually — this trips up nearly every first-time user and the README buries the openssl command at the bottom of the auth section. There's no built-in retry or backoff on APNS errors like 429 or 500; you own that logic. Connection pool configuration is opaque — you pass eventLoopGroupProvider but there's no obvious way to tune pool size for high-throughput workloads. Broadcast Channels (APNSwift's wrapper for Apple's new push-to-group feature) has almost no documentation beyond the source files, so you're reading code to understand the channel lifecycle.