Home

Awesome

Apple Push Notification (APNS) Setup Guide

:warning: Note this guide is quite old, additional resources below:

Guide to setup APNS - 2016

Steps

Create Certificates, Identifiers and Profiles

Log into the Apple Developer Member Center.

Create the App Identifier

Note: It may make sense to use separate bundle identifiers for development and production to allow devices to run both versions simultaneously.

Certificates

This guide uses the openssl command rather than Keychain Access because it's easier to script and works cross-platform.

Create the production APNS certificate

In the above steps you created a key and CSR for the sandbox APNS. To create an adhoc/production version:

Setup production push service for the App Identifier

Devices

Go to "Devices" and add the device ID (UDID) for any devices you'd like to test with

Provisioning Profiles

Final Steps

After following the above steps, you should files that are something similar to the following:

Production push key/certs:

Development push key/certs:

Provisioning profiles:

Signing

In addition to the above files, you'll want to keep track of your own iOS signing certificates which are split out into development and production versions. For development, you can generally re-use these certifiates across all of the apps in your account but it may be advisable to create separate production signing certificates for App Store releases.

You may generate your signing certificates using the same openssl-based steps above for creating the push certificates. Note: If you used the above commands, you'll need to import the .cer and .p12 files into your keychain in order for Xcode to be able to sign your apps.

Testing

To test connecting to the APNS gateway (the development sandbox in this case):

openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert YourApp-Development-Push.cert.pem -key YourApp-Development-Push.key.pem

APNS with over-the-air (OTA) Deployments

To get push notifications working with over-the-air builds, you need to create and use a production certificate. (The development certificates are intended to be used when installing your app directly from Xcode/organizer and will provide extra debug information.)

Tools

Here are some tools to help you with APNS :+1:

Contact