Article

Setting Up a Remote Notification Server

Set up a server to generate notifications and push them to user devices.

Overview

Remote notifications (also known as push notifications) let you push small amounts of data to devices on which your app is installed, even when your app isn't running. Apps use notifications to keep the user informed. For example, a messaging service sends remote notifications when new messages arrive for the user.

The delivery of remote notifications involves several key components:

  • Your company's server (known as the provider server)

  • Apple Push Notification service (APNs)

  • The user's device

  • Your app (running on the user's device).

Remote notifications begin with your company’s server. You decide when you want to send notifications to your users. When it's time to send a notification, you generate a request containing the notification data and a unique identifier for the user's device. You then forward your request to APNs, which handles the delivery of the notification to the user’s device. Upon receipt of the notification, the operating system on the user's device handles any user interactions and delivers the notification to your app.

Your company's provider server communicates with Apple Push Notification service, which in turn communicates with the user's devices.

You're responsible for setting up a provider server (or servers) and for configuring your app to handle notifications on the user's device. (Apple manages everything in between, including the presentation of notifications to the user.) You must also have an app running on the user's device that can communicate with your server and provide needed information. For information on how to configure your app to handle remote notifications, see Registering Your App with APNs.

Build Custom Infrastructure for Notifications

Here are the main tasks for setting up a remote notification server. How you implement these tasks depends on your infrastructure, and you are free to use whatever technologies that are appropriate for your company.

Establish a Trusted Connection to APNs

Communication between your provider server and APNs must take place over a secure connection. Creating that connection requires installing a GeoTrust Global CA root certificate on each of your provider servers. If your provider server runs macOS, this root certificate is in the keychain by default. On other systems, you might need to install this certificate yourself. You can download this certificate from the GeoTrust Root Certificates website.

To send notifications, your provider server must establish either token-based or certificate-based trust with APNs using HTTP/2 and TLS. Both techniques have advantages and disadvantages, so decide which technique is best suited for your company.

Understand What APNs Provides

APNs makes every effort to deliver your notifications, and to deliver them with the best user experience:

  • APNs manages an accredited, encrypted, and persistent IP connection to the user’s device.

  • APNs can store and forward notifications for a device that is currently offline.

  • APNs coalesces notifications with the same identifier.

Topics

Server Tasks

Generating a Remote Notification

Send notifications to the user’s device with a JSON payload.

Sending Notification Requests to APNs

Send your remote notification payload and device token information to APNs.

Pushing Updates to Your App Silently

Deliver silent notifications and wake up your app in the background on the user's device.

Security

Create a secure connection between your provider server and APNs.

Establishing a Token-Based Connection to APNs

Secure your communications with APNs using stateless authentication tokens.

Establishing a Certificate-Based Connection to APNs

Secure your communications with APNs by installing a certificate on your provider server.

See Also

Remote Notifications

Registering Your App with APNs

Communicate with APNs and receive a unique device token that identifies your app.