The goals of this section are to provision your app with Apple and grant OneSignal access to manage your notifications.
- A OneSignal Account if you do not already have one
- Your OneSignal App Auth Key, available in Keys & IDs
- A Mac with Xcode 8+. If you are using Xcode 7, PhoneGap Build, or Cordova, follow this guide instead.
We recently released a tool to automate this process!
-- OR --
1.1 Open Keychain Access on your Mac OS X system. It may be located in "Applications" > "Utilities" > "Keychain Access"
1.2 Select "Keychain Access">"Certificate Assistant">"Request a Certificate From a Certificate Authority..."
1.3 Select the "Save to disk" option and enter your information in the required fields. This creates a certification request file that will be used later.
2.1 Select your app from the Apple's Developer site and press "Edit"
2.2 Scroll down to the bottom and enable Push Notifications. Press Done, but do not configure either Production or Development certificate.
Instead, go to Add iOS Certificate and select "Apple Push Notification service SSL (Sandbox & Production)" and click Continue.
This certificate will be applicable to both Sandbox and Production environments, so you do not need a separate key for each one.
2.3 Choose an App ID from the App ID pop-up menu, and click Continue.
2.4 Press Continue
2.5 Press "Choose File..", select the "certSigningRequest" file you saved in step 1, press open, and then press "Generate".
2.6 Press Download to save your certificate
3.1 Open the .cer file you downloaded in the last step by double clicking on it in Finder.
3.2 After a few seconds the "Keychain Access" program should pop up. Select Login > My Certificates then right click on your key in the list and select "Export"
3.3 Give the file a unique name using the
.p12 extension, and press save. You will have an option to protect the file with a password. If you add a password, you need to enter this same password on OneSignal.
If you haven't already, you should set up your OneSignal account.
4.1 Select your app from the All Apps page in OneSignal, then go to "App Settings" and press Configure to the right of the Apple iOS Settings.
4.2 Select the .p12 you exported along with a password if you added one and press Save.
If you are running into any issues you can try troubleshooting them with our Troubleshooting iOS.
Done! You now have a certificate to send push notifications from your iOS app.
The Apple Push Notification Service (APNs) is a service created by Apple Inc. way back in 2009 to securely send push notifications from third party apps to their users' Apple devices.
Your backend sends notifications through Apple's servers to your application. To ensure that unwanted parties are not sending notifications to your application, Apple needs to know that only your servers can connect with theirs.
Apple therefore requires you to create an SSL certificate. Although app provisioning can be confusing at times, follow along and it should only take a couple minutes.