A push notification is a message your server sends to an iPhone through the Apple Push Notification service (APNs). A regular push payload can be up to 4 KB (4096 bytes) and a VoIP push up to 5 KB (5120 bytes), per Apple’s documentation as of October 17, 2026.
How pushes work on iPhone
Your app doesn’t receive remote notifications itself, the system does. At launch the app registers with APNs and gets an address that lets Apple find this app on this device. You send that address to your server, and the server posts a JSON request to APNs over HTTP/2 on port 443 or 2197. The legacy binary APNs protocol stopped working on March 31, 2021.
Besides regular notifications with text and sound, the same channel carries quiet background pushes, VoIP calls, and updates for widgets and Live Activities. The apns-push-type header names the kind of push, and it has to match the payload.
Where it lives in Xcode and your developer account
In Xcode open the app target, go to Signing & Capabilities, click + Capability and add Push Notifications. Xcode adds the aps-environment entitlement, and the App ID in your account must have the push service turned on.
The server key comes from developer.apple.com. Go to Certificates, IDs & Profiles › Keys › +, check Apple Push Notification service, pick the environment and the key type, Team Scoped or Topic Specific, and download the .p8 file. Only the Account Holder or an Admin can create one. You can download the file once, because Apple doesn’t keep a copy.
Apple’s limits and numbers
| What | Value |
|---|---|
| Payload | up to 4 KB (4096 bytes), uncompressed |
| VoIP push | up to 5 KB (5120 bytes) |
| apns-priority | 10 immediately (default), 5 with power in mind, 1 without waking the device |
| Quiet background push | priority 5 only, 10 is an error |
| Storing undelivered pushes | up to 30 days per apns-expiration, one notification per bundle ID |
| apns-collapse-id | up to 64 bytes |
| JWT for a .p8 key | refresh no more than once every 20 minutes and no less than once every 60 |
| Certificate instead of a key | one per app, valid for a year |
| Action buttons | up to four in an expanded notification |
Per Apple’s documentation (Sending notification requests to APNs, Generating a remote notification, JWT, certificate), Account Help and the HIG, checked October 17, 2026.
A .p8 key or a certificate
A .p8 key is the easier choice almost every time. One key covers all of your team’s apps, works in both the development and production environments, and doesn’t expire until you revoke it. Your server signs a JWT with it and renews that signature every 20 to 60 minutes, or APNs answers with a 403 ExpiredProviderToken error.
A certificate is tied to one app, so you issue one per app and renew it every year. A forgotten renewal quietly stops every push. Certificates and signing profiles are covered on the certificates page.
Permission, quiet delivery and interruption levels
You can show notifications only after the person agrees. The system asks the requestAuthorization question once, and later calls don’t show the dialog again, so Apple suggests asking when the benefit is obvious, for example after someone creates a first task. Timing of that question is covered on the onboarding page.
Since iOS 12 there is provisional authorization. Notifications arrive quietly, only in Notification Center history, with buttons to keep them or turn them off, and no permission dialog appears at all. Since iOS 15, released in 2021, a notification has one of four interruption levels. Passive doesn’t light the screen, active is the default, time-sensitive breaks through the notification summary and Focus, and critical plays a sound even when the phone is muted and needs Apple’s approval.
How to set up pushes, step by step
- Create a .p8 key in Certificates, IDs & Profiles and immediately store the file, the Key ID and your Team ID somewhere safe.
- Add the Push Notifications capability in Xcode.
- Ask for permission at a clear moment or start with provisional delivery.
- Call registerForRemoteNotifications at every launch and send the fresh device address to your server.
- Debug against the APNs development server (sandbox), and send requests for the released app to the production server.
- Set apns-push-type and the priority to match the content, using 10 only for what matters right now.
Common mistakes
- Asking on the first screen. The person doesn’t yet see why notifications matter, says no, and the system won’t show the dialog a second time.
- Saving the address once and forever. Apple asks you to register at every launch and send the address to your server again, and one address can’t serve several apps even on the same phone.
- A heavy payload. APNs refuses a push over 4096 bytes. Send an identifier and let the app fetch the data itself.
- Sending the same thing several times. Apple advises against it directly, because people end up turning off all of the app’s notifications.
In an app made with Appto, the agent writes the notification code together with the rest of the SwiftUI app, and you can check it by hand on your own iPhone or through TestFlight. More on the code page.
Questions
What is the maximum push notification size?
4 KB, or 4096 bytes of JSON payload for a regular push, and 5 KB (5120 bytes) for VoIP. APNs doesn’t accept compressed JSON (Apple documentation as of October 17, 2026).
Does an APNs .p8 key expire?
No. The key doesn’t expire unless you revoke it, and it works for all of your team’s apps. Only the JWT signed with it expires, and you renew it every 20 to 60 minutes.
What is provisional authorization?
A trial permission available since iOS 12. The app gets it without a dialog, notifications arrive quietly in Notification Center, and the person decides whether to keep or turn them off.
Can you ask for notification permission twice?
The system shows the dialog only on the first request. If the person declined, another request shows nothing, and notifications can then be turned on only in the iPhone’s Settings.
How is time-sensitive different from critical?
Both levels arrived in iOS 15. Time-sensitive breaks through the summary and Focus, and people can disallow that. Critical plays even on a muted phone and needs an entitlement Apple grants on request.
Build your own app in Appto
Appto checks the niche on fresh App Store data, designs the screens, writes the code, builds the App Store page and submits to Apple from your account or shows you what to press in App Store Connect. Runs on your own Claude Code or Codex.
Download for Mac