To prepare for push notifications on iOS, you need to create a push-enabled App ID
and a production push certificate.
If you already have a push-enabled App ID and a production push certificate, you can
skip this section. Note that you may still need to complete steps 9 and above in
order to convert your certificate to the right format.
-
Log in to your Apple developer account.
-
In the iOS Apps menu, click
Identifiers.
-
Note: If you don't yet have an App ID, click + to create
one.
In the App IDs section, select the App ID that you use
for App Store and/or ad-hoc distribution and click Edit.
-
Select the checkbox to enable Push Notifications. Then, click Create
Certificate.
Instructions for generating a Certificate Signing Request (CSR)
appear.
-
Follow the instructions to generate the CSR, and then click
Continue.
-
In the Generate Your Certificate pane, click
Choose File.
-
Navigate to the CSR file you created in the previous step and select it. Click
Generate.
-
Click Download Now to download the certificate file to
your download location. Open the .cer file to install it in your keychain. When
you are finished, click Done.
-
Double-click the file to launch Keychain Access. Ensure that the certificate in
your login keychain is installed on the computer you are using for provider
development.
-
In Keychain Access, ensure that your certificate User ID matches your
application’s Bundle ID.
You can find your application's Bundle ID in Xcode by clicking on the project
in the navigator and selecting . The Bundle ID is shown on the top.
-
Select the certificate, choose , and export it as a Personal Information Exchange (.p12)
file.
-
In a terminal, run the following command.
openssl pkcs12 -in CertificateName.p12 -out CertificateName.pem -nodes
Note: Ensure that the password is correct. The private key can sometimes fail to
be included in the certificate when the wrong password is entered.
-
Make a note of the .pem file location.