Download

iOS push notifications through APNs. Limits, keys, priorities and permission

What your server needs to send a notification to an iPhone, how big it can be and how not to lose the person’s consent on the very first question.

In short

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

WhatValue
Payloadup to 4 KB (4096 bytes), uncompressed
VoIP pushup to 5 KB (5120 bytes)
apns-priority10 immediately (default), 5 with power in mind, 1 without waking the device
Quiet background pushpriority 5 only, 10 is an error
Storing undelivered pushesup to 30 days per apns-expiration, one notification per bundle ID
apns-collapse-idup to 64 bytes
JWT for a .p8 keyrefresh no more than once every 20 minutes and no less than once every 60
Certificate instead of a keyone per app, valid for a year
Action buttonsup 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 push notification’s path from key to screenA push notification’s path per Apple’s documentation as of October 17, 2026, six steps. 1. A .p8 key under Keys in Certificates, IDs & Profiles, which you can download only once. 2. The Push Notifications capability on the Signing & Capabilities tab in Xcode, which adds the aps-environment entitlement. 3. Permission through requestAuthorization, and the system asks the person once. 4. The device address through registerForRemoteNotifications, and each app gets its own. 5. A request to the APNs server, with the signed JWT refreshed no more than once every 20 minutes and no less than once every 60 minutes. 6. Delivery to the iPhone, with a payload of up to 4 KB, and APNs keeps an undelivered notification for up to 30 days.A push notification’s path from key to screenSteps per Apple’s documentation as of October 17, 20261A .p8 keyCertificates, IDs & Profiles › Keysyou can download it once2Push capabilityXcode › Signing & Capabilitiesadds aps-environment3PermissionrequestAuthorizationthe system asks once4Device addressregisterForRemoteNotificationseach app gets its own5Request to APNsсервер APNs Applerefresh the JWT every 20–60 min6Deliverythe person’s iPhoneup to 4 KB, kept up to 30 days
You can download the .p8 file only once, and the system shows the permission dialog only once too, so plan these two steps in advance. Per the APNs documentation and Account Help, 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

  1. Create a .p8 key in Certificates, IDs & Profiles and immediately store the file, the Key ID and your Team ID somewhere safe.
  2. Add the Push Notifications capability in Xcode.
  3. Ask for permission at a clear moment or start with provisional delivery.
  4. Call registerForRemoteNotifications at every launch and send the fresh device address to your server.
  5. Debug against the APNs development server (sandbox), and send requests for the released app to the production server.
  6. 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