Generate push certificate
The Apple Push Notification Service (APNs) allows only your backend to send notifications through Apple’s servers to your application.
Required for setup
- Ocamba account, if you don’t have create one here.
- OcambaHood framework, download here.
- An iOS Push Certificate
- An iOS Push Service Extension.
- An App groups enabled.
- An iOS device (iPhone, iPad) to test on. Real device needed.
- A Mac with a new version of Xcode.
1. Generate an iOS Push Certificate
In order to generate push certificate you need a Paid Apple Developer Account with Admin Role and an application for which you are generating that push certificate.
2. Provisioning
Open Keychain Access on your Mac OS X system. It may be located in “Applications” -> “Utilities” -> “Keychain Access”.
Select “Keychain Access” -> “Certificate Assistant” -> “Request a Certificate From a Certificate Authority”.
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.
3. Enable Push Notifications and create Push Certificate
Select your Identifier in your Apple Developer Account -> Certificates, IDs & Profiles -> Identifiers.
Scroll down to the bottom and enable Push Notifications, but do not click Configure.
Instead, go to Create a New Certificate by clicking the blue + button on Certificates and under Services 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.
Choose an App ID from the shown pop-up menu, and click Continue.
Press “Choose File..”, select the “CertSigningRequest” file, press Open, then press Continue.
Press Download to save your certificate.
4. Creating a private key
Open the .cer file previously downloaded by double clicking on it in Finder.
Wait for the “Keychain Access” program to pop up. Select Login -> My Certificates then right click on your key in the list and select Export.
Give the file a unique name using the .p12 extension, and press save. You can protect the file with a password. If you add a password, you need to enter this same password on Ocamba portal.
5. Configure your App’s settings
Enter Private Key Password and Upload .p12 file to Ocamba.