Enabling Push Notifications in Xcode project
- Choose View → Navigators → Show Project Navigator.
- Choose the target from the Project/Targets pop-up menu or in the Targets section of the second sidebar if it appears.
- Click Capabilities to view app services you can add to your app.
- In the Capabilities pane, if Push Notifications isn’t enabled, click the switch in the Push Notifications section.
- In Member Center, the Push Notifications service will appear as Configurable (not Enabled) until you create a client SSL certificate.
Creating a Universal Push Notification Client SSL Certificate
You use Member Center to generate a push notification client SSL certificate that allows your notification server to connect to the APNs. Each App ID is required to have its own client SSL certificate. The client SSL certificate Member Center generates is a universal certificate that allows your app to connect to both the development and production environments.
To generate a universal client SSL certificate:
- Go to your Apple's dev center.
- In Certificates, Identifiers & Profiles, select Certificates.
- Click the Add button (+) in the upper-right corner.
- Under Production, select the "Apple Push Notification service SSL (Sandbox & Production)" checkbox, and click Continue.
- Choose the explicit App ID that matches your bundle ID from the App ID pop-up menu, and click Continue.
- Follow the instructions on the next webpage to create a certificate request on your Mac, and click Continue.
- Click Choose File.
- In the dialog that appears, select the certificate request file (with a
.certSigningRequestextension), and click Choose.
- Click Generate.
- Click Download and save the file (
- Click Done.
Generate the SSL certificate for Push Notifications for WordPress
aps.cerin the Keychain Access double-clicking on it.
- From the Keychain Access application select the certificate (search for "Apple Push Services") and press the right mouse button.
- Select "Export" and save it as
Certificates.p12using a password that you remember.
- From the command line, in the same directory where you have saved the certificates enter this command:
$ openssl x509 -in aps.cer -inform der -out Cert.pem
- Then, from the same position enter this:
$ openssl pkcs12 -nocerts -out Key.pem -in Certificates.p12
It will ask an import password (the one you have used in step 3) and then a secure password for the certificate (the one you will use in Push Notifications for WordPress).
- At this point merge the certificate and the key together:
$ cat Cert.pem Key.pem > ck.pem
ck.pemfile will be the one you have to use in Push Notifications for WordPress.
Configure Push Notifications for WordPress
- Go to Push Notifications → Settings → iOS tab.
- Click the Upload button.
- Drag and drop the
- Click Select.
- Enter the password you have selected for the certificate.
- Click Save Settings.
With the new certificate system implemented by Apple you can use the same certificate both in distribution and development.