iOS Push Notifications Explained
What is an iOS Push Notification?
An iOS push notification is a message that pops up on an Apple device such as an iPhone. Before receiving push notifications from an app, iOS device users must explicitly give permission. Once a user opts-in, mobile app publishers can send push notifications to the users’ mobile devices. Plus, iOS users don’t have to be in the app or active on their devices at that moment to receive them.
Learn more about push notification use cases in our Push Notification Explainer.
How do iOS Push Notifications Work?
You can generate notifications locally from the app or remotely from a server that you manage. Local notifications take advantage of events like a time or location to create notification content and trigger the delivery of the notification. For remote notifications, your company’s server generates push notifications, and Apple Push Notification service (APNs) handles the delivery of those notifications to users’ devices.
There are several distinct entities involved in sending an iOS push notification:
- Provider: A provider is a server that you deploy, manage and configure to work with APNs
- APNs: Apple Push Notification service, which is described in more detail below
- Client device: The targeted device, such as an iPhone
- Client app: the developer’s mobile app
Once you’ve completed setting up push notifications on your providers and in your app, your providers can send notification requests to APNs. APNs then delivers the notification to each targeted device. Once APNs receives a notification, the system delivers the notification to the appropriate app on the device.
If a notification arrives while the device is powered on but the app is not running, the system can still display the notification. Plus, if the device is powered off when a notification is sent, APNs will actually hold onto the notification and retry when the device is on again.
What is Apple Push Notification Service (APNs)?
APNs enables third party application developers to send notification data to applications installed on Apple devices. According to Apple, APNs is “the centerpiece of the remote notifications feature.” They describe it as “a robust, secure, and highly efficient service for app developers to propagate information to iOS (and, indirectly, watchOS), tvOS, and macOS devices.”
How are iOS Push Notifications Displayed?
Depending on the users’ device settings, there are three places where notifications are displayed.
- A pop-up when the user is using the phone
- In the notification center
- On the lock screen (unless disabled)
What is the Character Limit for iOS Push Notifications?
iOS devices have guidelines that can truncate notifications so that they fit in each notification delivery style. For both iOS lock screen and Notification Center, the iOS byte limit provides space for roughly 4 lines of text.
As a general rule, we recommend trying to get the most important, actionable part of your message across in the first 40 characters. This ensures it’s optimally displayed across most devices and operating systems, without truncating essential information.
These guidelines are a great reference for crafting your message. But you should always test, test, test! With so many different device sizes and iOS updates, it’s important to test to ensure your content will fit the devices you’re targeting.
How to Test iOS Push Notifications
Before you can test iOS push notifications with Airship, you’ll need to take several steps.
- Register your device’s push notification token
- Obtain your app’s push notification certificate
- Implement the Airship SDK in your app
Next, we’ll describe how to obtain these essentials.
- Register your device token for push notifications in iOS
Before you can use APNs, you must register your app and retrieve your app’s device token. This is because APNs must know the address of a user’s device before sending notifications to the device. This globally unique device token is effectively the address of your app on the current device. Your server includes that token with any notifications it sends.
- Obtain an iOS push notification certificate through apple developer portal
To secure your communications with APNs you can install a certificate on your provider server. Provider certificates are obtained through your developer account on developer.apple.com. With certificate-based authentication, you use a provider certificate to establish a secure connection between your provider server and APNs.
- Successfully implement the Airship SDK in your app
Before sending a test notification, you must have successfully implemented the Airship SDK in your app. Further information can be found on our Developer Resources Page. When integrating the Airship SDK into your app, it is helpful to send a notification to a select group of test devices.
Airship’s official documentation explains how to send notifications to test devices. For more information, visit our documentation on setting up and sending to a Test Devices Group.
Changes to Push Notifications in iOS15
In 2021, Apple announced significant changes designed to improve the user experience by making notifications easier to read and manage, while also focusing on user privacy. This includes a daily summary of non-critical notifications so that users can receive fewer interruptions during their day. There’s also Apple’s new focus feature, which allows users to set up notification preferences based on their status. For example, a user might choose to limit notifications during specific activities like driving, working, sleeping or through custom categories that they define.