Getting an iOS push notification from your server to a user's lock screen takes four moving parts working together: an entitlement in Xcode, a capability on your App ID, an APNs credential (.p8 key or .p12 certificate), and a server or platform that talks to Apple Push Notification service. Miss any one and the failure is silent: no error dialog, just notifications that never arrive. This guide walks the full setup in order, flags the two mistakes that cause most "push works in debug but not in TestFlight" tickets, and finishes with a no-code console route for teams that would rather not run their own push server.
iOS push notification setup at a glance
- Enable the Push Notifications capability in Xcode and register for remote notifications in code.
- Turn on push for your App ID in the Apple Developer portal.
- Create an APNs credential: a .p8 token key (recommended) or a .p12 certificate.
- Upload the credential to your push server or platform and integrate the SDK.
- Send a test to a real device, then verify delivery in your analytics before going to production.
Part 1. How iOS Push Notifications and APNs Work
Every remote notification on iOS travels through Apple Push Notification service (APNs). There is no way around it: your server never talks to the device directly. It sends a payload plus a device token to APNs, and APNs decides how and when the device receives it. According to Apple Developer Documentation (2026) , a notification can render as an alert, play a sound, update the app badge, or arrive silently as a background update.
1. The APNs delivery flow
- Device registration: on first launch, your app asks iOS for permission and registers with APNs. APNs returns a device token, the address every later send is aimed at.
- Server request: your provider server (or push platform) sends an HTTP/2 POST to APNs containing the device token and the JSON payload.
- Authentication: APNs validates the request against your .p8 token or .p12 certificate before accepting it.
- Delivery: APNs routes the notification to the device. If the device is offline, APNs stores the most recent notification for a limited time and delivers it when the device reconnects.
2. The two decisions that shape your setup
Before touching Xcode, settle two choices, because both surface later as delivery bugs. First, credential type : a .p8 token key works for all your apps and never expires, while a .p12 certificate is per-app and expires every year (an expired certificate is a classic cause of push silently dying in production). Second, APNs environment : development builds talk to the sandbox environment, App Store and TestFlight builds talk to production, and a token from one environment is invalid in the other. For a deeper look at how APNs itself behaves, see our Apple Push Notification service guide .
Part 2. How to Set Up iOS Push Notifications in Your App
Work through the six steps in order; each one depends on the one before it.
Prerequisites
- A paid Apple Developer Program membership (US$99/year); the push entitlement is not available on free accounts.
- A Mac with a current Xcode version.
- A physical iPhone or iPad for testing. Simulators only receive remote push on Apple silicon Macs with Xcode 14 or later, and behaviour still differs from real devices.
1. Enable the capability in Xcode and register in code
Open your project, select the app target, and in the Signing & Capabilities tab click + Capability and add Push Notifications . This writes the aps-environment entitlement into your app.
Then request permission and register at launch: call UNUserNotificationCenter.current().requestAuthorization(options:)
, and on consent call
UIApplication.shared.registerForRemoteNotifications()
. The device token arrives in
application(_:didRegisterForRemoteNotificationsWithDeviceToken:)
; forward it to your server.
2. Turn on push for the App ID in the Developer portal
Sign in at developer.apple.com , open Certificates, IDs & Profiles , then Identifiers , and select your app's App ID.
In the Capabilities tab, tick Push Notifications and save. If your app already shipped, regenerate and re-download the provisioning profile afterwards, or the entitlement will not reach the build.
3. Create your APNs credential: .p8 key or .p12 certificate
Both credentials authenticate your server to APNs; they differ in maintenance cost.
| Credential | Scope and lifetime | Pick it when |
|---|---|---|
| .p8 token key | One key for every app on the account; never expires; works for sandbox and production | Default choice; Apple recommends it and there is nothing to renew |
| .p12 certificate | Per app and per environment; expires every 12 months | A legacy provider or internal system only accepts certificates |
For the token route, create a key with APNs enabled under Keys in the Developer portal and download the .p8 file once (Apple never re-issues it), following Apple's token-based connection guide . For the certificate route, create the APNs certificate, install it, then export it from Keychain Access as a .p12 file.
4. Upload the credential to your push server or platform
If you run your own provider server, load the .p8 key into your APNs client library and start sending HTTP/2 requests. Most teams instead upload the credential to a push platform once and let it manage connections, retries, and token feedback. In the platform console, open your app's Integration Settings , choose iOS Certificate Configuration or Token Authentication Configuration , upload the file, and set the matching APNs environment.
5. Integrate the iOS SDK
A platform SDK wraps registration, token upload, and delivery callbacks so you do not hand-roll them. Follow your provider's integration doc, for example the EngageLab iOS SDK integration guide . One check saves hours here: make sure the SDK's configured environment matches your build type, because a development build pointed at production APNs returns BadDeviceToken on every send.
6. Send a test and read the result
Send a test notification to your own device before any campaign. If nothing arrives, check the three usual suspects in order: notification permission was denied on the device, the APNs environment does not match the build, or the device token is stale (APNs returns 410 Unregistered for tokens from deleted installs). A delivered test on a physical device is your green light for production.
Part 3. Send iOS Push Notifications From a Console (No Code)
Once the credential and SDK from Part 2 are in place, marketers and product teams can create and send every campaign from a console instead of calling APNs from code. The steps below use the EngageLab AppPush console ; the sequence maps one-to-one onto most managed platforms.
1. Open the AppPush service and note the AppKey
Create an account , open AppPush , and create your app. Note the AppKey : it ties the SDK integration, credentials, and every report back to this app.
2. Create the notification content
Open Create Push and fill in Notification Content : title, body, and target platform (select iOS). Write the plain-text alert first, then attach rich media if the campaign needs it; the live preview updates as you type. For image and action-button formats, see our rich push notifications guide .
3. Choose the target audience
Under Target Audience , narrow by device tag , alias , or a saved segment rather than broadcasting to all users. Start with a small internal tag group for the first send; widening a working campaign is cheap, apologising for a mistargeted blast is not.
4. Set iOS-specific options and schedule
In Advanced options , set the pieces iOS users actually notice: badge behaviour, sound, time-to-live for offline devices, and whether the message is a visible alert or a silent background push. Schedule with a Timed Task to send in each recipient's time zone, and cap frequency so one user is never flooded.
5. Measure delivery and clicks
After sending, open Survey → Conversion Rate Trends for the full funnel: Targets , Sent , Delivered , and Clicks , with delivery rate and CTR per channel. The biggest drop between two funnel stages tells you where the next fix lives.
6. Diagnose what did not arrive
Survey → Loss Analysis breaks undelivered sends out by reason, such as TIMEOUT_OFFLINE and USER_INVALID . On iOS, a spike in invalid users usually means stale tokens from uninstalls; clean them from your audience before the next campaign instead of after it.
Part 4. When a Managed Push Platform Earns Its Place
Raw APNs plus your own server is a perfectly good stack for a single iOS app with engineering capacity: delivery is free and you control everything. A managed platform starts paying for itself when any of these become true: your audience spans iOS, Android, and web and you want one send pipeline; non-engineers need to create and schedule campaigns; or you need per-send delivery and loss reporting that raw APNs does not expose. EngageLab covers that profile with segmentation, recipient time-zone delivery, A/B testing, funnel and loss analytics, and a 30-day free trial with every feature enabled, so you can validate delivery on your own traffic before paying. Teams comparing several vendors first can shortlist with our push notification service comparison .
Frequently Asked Questions
Do I need a paid Apple Developer account for push notifications?
Yes. The push notification entitlement requires the paid Apple Developer Program (US$99/year). Free provisioning profiles cannot register with APNs, so plan the membership before scheduling any push work.
Can I test iOS push notifications in the simulator?
Partially. Simulators on Apple silicon Macs running Xcode 14 or later can receive remote push, and any simulator accepts drag-and-dropped .apns payload files for UI checks. Delivery timing, permission prompts, and background behaviour still differ from hardware, so always confirm on a physical device before release.
Should I use a .p8 key or a .p12 certificate for APNs?
Use the .p8 token key unless a legacy system forces certificates. One key serves every app on your account, never expires, and works in both APNs environments. Certificates are per-app and expire yearly, which is why an unnoticed renewal date is one of the most common causes of production push suddenly stopping.
Why are my iOS push notifications not being delivered?
Check four things in order: the user denied notification permission; the APNs environment does not match the build (sandbox token sent to production returns BadDeviceToken ); the device token is stale after an uninstall (410 Unregistered ); or the .p12 certificate expired. A per-reason loss report like the one in Part 3 turns this from guesswork into a checklist.
Conclusion
Setting up iOS push notifications is a chain: Xcode capability, App ID, APNs credential, server or SDK, then a verified test send. Do the .p8-versus-.p12 and sandbox-versus-production decisions consciously and the chain rarely breaks; skip them and you inherit the classic silent failures. If you want the delivery infrastructure, console sending, and loss diagnostics handled for you, start the 30-day free trial , connect your APNs credential, and send your first test in an afternoon.
Ship your first iOS push this week
Upload your .p8 key, integrate the SDK, and send a real-device test from the console, with funnel and loss analytics included from day one of the 30-day free trial.
Last updated: July 2026.







