How push notifications are delivered

Platform & distribution Mid-level Swift 5.0+ iOS 17+ Reviewed By Alok Singh

Order the steps

Put the push setup and delivery steps in order.

  • The server sends the payload to APNs with a JWT
  • Receive the device token in didRegisterForRemoteNotificationsWithDeviceToken
  • APNs delivers the notification to the device
  • Send the token to your server
  • Call registerForRemoteNotifications()
  • Ask for notification permission
Hint 1 of 1

Permission comes first.

Choose an answer, then open Show answer below to check it.

Show answer

Answer: F E B D A C

  1. Ask for notification permission Users must allow alerts, sounds and badges.
  2. Call registerForRemoteNotifications() The app registers with APNs.
  3. Receive the device token in didRegisterForRemoteNotificationsWithDeviceToken The token identifies this app on this device.
  4. Send the token to your server The server needs it to address the push.
  5. The server sends the payload to APNs with a JWT APNs authenticates the provider.
  6. APNs delivers the notification to the device The system shows it or wakes the app.

30-second answer

The app asks for permission with UNUserNotificationCenter, registers with registerForRemoteNotifications(), and receives a device token in application(_:didRegisterForRemoteNotificationsWithDeviceToken:). It sends the token to your server. The server sends a JSON payload to APNs over HTTP/2, authenticated with a token (JWT) or certificate, and APNs delivers it to the device, which shows it or wakes the app.

Practise saying it · 45 s. No recording, just a timer

Explain how a push reaches the device.

Say your answer out loud, then check which of these points you covered:

  • Permission and registration
  • Device token to server
  • Server to APNs
  • Delivery

Deep dive

Tokens can change; send them to your server on every launch.

mutable-content: 1 lets a Notification Service Extension modify the content.

content-available: 1 with apns-push-type background wakes the app silently, but is throttled.

Use the sandbox APNs host for development builds.

Common mistakes

  • Caching the token forever.
  • Relying on silent pushes for timely work.

Senior take & follow-ups

Seniors trace the whole path and know the common failure points.

Follow-up questions

Think of your answer first, then open the hint.

  1. What does apns-push-type do?

    Show hint

    Tells APNs the kind of push; it's required on watchOS and recommended everywhere.

  2. Why might a push not arrive?

    Show hint

    Wrong environment, expired token, bad topic, or throttled background pushes.

From the author

Push Notification Tester

Made by the author: send real APNs pushes to your own device to try the push questions on this page for yourself.

Suggest a fix if something here is wrong or out of date.