Apple Push Notification service (APNs)

What is Apple Push Notification service?

Apple Push Notification service (APNs) is a delivery service provided by Apple to its iOS ecosystem which carries messages from remote servers to devices such as iPhones, iPads, and Macs. The role of the app server in all this is to act as an intermediary between the app server and the devices via the facilitation of real-time information transmission. When the development team aims to deliver a push notification to the user’s device, they employ an APN to send that message directly to the device’s operating system. Then, the user receives the notification.

Apart from that, APNs are responsible for providing users with relevant information about the apps where they install them and making it more straightforward for them to stay updated.

An explanatory graphic of how push notifications work, from when a user allows a notification from an app, through the full cycle of the app server, and the APNs, and finally delivering the notification back to the user's device
Diagram of the push notification process with five key stages

Types of Notifications

APNs offer various forms of notification that can be delivered to Apple gadgets. These notifications consist of badges, sounds, and custom text alerts. Badges are small numerical symbols that appear on app icons, indicating the existence of new content or unread messages. Notifications can be accompanied by sounds to attract users’ attention and to act as an audible alert. Custom text alerts allow developers to send dedicated messages, which contain information about app use, directly to the users.

With these different sorts of notifications, developers can design fascinating and interactive activities for their application users. Be it a game informing the player about a new level or a messaging app sending real-time messages, APNs remain the central means of reachability for various sorts of notifications.

Evolution of APNs

APNs was first introduced by Apple on June 9, 2008, at WWDC (Worldwide Developer Conference). Initially, the acceptance of APNs faced scalability issues due to the high number of push notifications and the subsequent delays in the delivery of the notifications. Apple opened the APNs access for Mac OS X, which allowed developers to transmit push notifications to Macs and provided a unified experience for users across Apple devices.

Technical Enhancements in APNs

Through the years, APNs have gone under various technical modifications to boost its capabilities and effectiveness. A noticeable upgrade was the increase in the notification payloads from 256 bytes to 2 kilobytes. Apple also created a more efficient sending interface that reduced the overhead and increased the general efficiency of APNs. One of the key APN improvements was the switching of the HTTP/2 provider API. This introduced some benefits, such as faster and more efficient delivery of push notifications to devices through multiplexing.

Network Requirements and Specifications

Certain protocols and standards should be in place to establish the connection between app servers and APNs. APN uses particular TCP ports for communication, and therefore, it is necessary that they to be open and accessible.

  • Port 5223: This port communicates with the APNs feedback service. The feedback service enables app servers to fetch data about devices that have removed an app or switched off push notifications.
  • Port 443: This port is used to communicate the API of the APN’s provider. It is the communication channel from app servers to APNs through which push notifications are sent to user devices.

Occasionally, these ports may be blocked by firewall restrictions or configured so that direct access is not allowed. To overcome these limitations, the developers may adopt alternative solutions like HTTP/2 or APN-supporting third-party push notification services.

Port NumberFunctionalitySolutions for Access Issues
5223Used for retrieving information about devices that have uninstalled an app or disabled notificationsUtilize alternative methods such as HTTP/2 or third-party push notification providers for APNs support
443Main port for sending push notifications from app servers to APNsUtilize alternative methods such as HTTP/2 or third-party push notification providers for APNs support

References

  1. Apple Push Notification Service” Notifications Overview – Apple Developer
  2. Apple Push Notification service – Wikipedia
  3. iOS Push Notifications Explained | Airship
  4. iOS remote push notifications in a nutshell | by Deyan Aleksandrov | Medium

Additional Resources