How does iOS push notification work?

Achsuthan Mahendran
3 min readJun 18, 2022

--

This article will explain, how the iOS push notification works in architecture level. This article is built for beginners to get some understanding of what is push notification and how it’s working.

What is a push notification?

A push notification is a message which pops up on mobile devices. To receive the push notification, it doesn’t matter user needs to keep open the app, regardless of application status(background/foreground) based on the configuration the push notification will be displayed to the user.

To configure the push notification, the application should have some configurations like

  1. How the notification should be presented user as a banner or alert?
  2. Any sound should be played once the notification is received?
  3. Any badge should be displayed to the user?

Why the push notification used?

Usually, the system wants to communicate with the user in specific purposes like,

  1. If the system is a Taxi booking or food ordering app, the system wants to inform the user about the booking status
  2. If a sports-related app, the system wants to send the score details to the user.
  3. If the the system is a news related app, based on the user subscription/preferences system can send specific news to user.
  4. Market their products or send out the promotion details to the user
  5. Improve the customer experiences

How the push notification works in iOS

The below diagram explains how the app communicates with APNS(Apple Push Notification Services) to send out the push notification.

Architecture diagram of how iOS push notification works.
  1. In the first stage, app communicate with APNS to get the device token with the configurations
  2. Once the app requested the token, APNS will provide the device token to the app
  3. The app needs to send it to its server or they can use any other third-party providers who are providing the push services.
  4. If the system is using its own architecture, they just needs to get the device token from the database and send the request to apple with push details and device token, then APNS will deliver the push to specific user(s)
  5. If the system is using the third-party providers, then the system needs to store some information based on the third-party provider(Eg: If Firebase is used then it’s an FCM token)
  6. Then when they want to send the push, they send the push message details and user-specific identification(Eg: If Firebase is used then it’s an FCM token).
  7. Then the third-party provider will communicate with APNS to send the notification to a specific user(s)

Conclusion

This article explained the overall architecture of how push notification works in iOS. Here is the next part of this article, How to configure the iOS app to receive the push notification.

Let me know if you would like me to write an article about what are the notification service providers available and how they can be implemented in the iOS app.

I hope you got some understanding about iOS push notificaiton. If you have any comments please feel free to add. Give some claps 👏 which will give me some boost to write more articles.

--

--

Achsuthan Mahendran
Achsuthan Mahendran

Written by Achsuthan Mahendran

iOS Developer, Web Developer, Flutter Developer. GitHub: achsuthan