Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training,
learning paths, books, tutorials, and more.

17.8. Delivering Push Notifications to Your App

Problem

You want to be able to send push notifications to users’
devices that are registered for push notifications.

Solution

Ensure that you have collected their push notification token
identifiers (see Recipe 17.7). Then generate
the SSL certificates that will be used by your web services to send push
notifications to devices. Once done, create a simple web service to send
push notifications to registered devices.

Note

This recipe is a follow-up to Recipe 17.7. Ensure that
you have read and understood that recipe before proceeding with this
one.

Discussion

In order to be able to communicate with the APNS, your web
services need to do handshaking with the APNS using
an Apple-issued SSL certificate. To generate this certificate, follow
these steps:

Navigate to the Certificates, Identifiers & Profiles
section on the righthand side.

In the App IDs section, find the App ID for your app that has
push notifications set up for it, select that App ID, and press the
Settings button to configure it, as shown in Figure 17-8.

Figure 17-8. Modifying the settings of an existing App ID

In the Push Notifications section of the settings, under the
Development SSL Certificate section, press the Create Certificate
button (see Figure 17-9) and follow the guidance that Apple will provide you to create your certificate. We are creating the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training,
learning paths, books, interactive tutorials, and more.