How does iOS push notification work?
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
- How the notification should be presented user as a banner or alert?
- Any sound should be played once the notification is received?
- 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,
- If the system is a Taxi booking or food ordering app, the system wants to inform the user about the booking status
- If a sports-related app, the system wants to send the score details to the user.
- If the the system is a news related app, based on the user subscription/preferences system can send specific news to user.
- Market their products or send out the promotion details to the user
- 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.
- In the first stage, app communicate with APNS to get the device token with the configurations
- Once the app requested the token, APNS will provide the device token to the app
- The app needs to send it to its server or they can use any other third-party providers who are providing the push services.
- 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)
- 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)
- 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).
- Then the third-party provider will communicate with APNS to send the notification to a specific user(s)
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.
How to configure the iOS app to receive the push notification?
This article is the second part of the push notification series. If you haven’t seen what is the first part, it’s all…
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.