Obtaining Apple Push Notification service certificates

Last updated: 2020-03-13 15:32:46

PDF

Generating a CSR File

Follow these steps to generate a Certificate Signing Request (CSR).

Specify the email address (of the paid account for applying for an AppID) and common name (the name of your computer by default, which does not need to be changed). Then, select "Save to disk".

Click "Continue".

The CSR file TXIMDemoAPS.certSigningRequest is created locally.

Creating an App ID

Log in to developer.apple.com and click "Member Center".

On the page that appears, select "Certificates, Identifiers & Profiles".

Select "Identifiers" to go to the identifier management page.

Generate an app ID as follows:
Click "App IDs" under "Identifiers", and a list of app IDs appears on the right. Skip to step 3 if you have already configured your app. Otherwise, click "+" to add an app ID.

For "App ID Description", you can enter your project name. For "Bundle ID", which can be found under the "General" tab of your project, it is usually in com.youcompany.youprojname format. Select the checkbox for "Push Notifications" and click "Continue".

Click "Submit".

Creating an APS Certificate for the App

Return to "App IDs", select the app that needs push notifications, and then click "Edit".

Scroll down to "Push Notifications" and click "Create Certificate…" to create a push certificate. Development certificates and production certificates need to be created separately, which means you need to go through the same process twice.

Click "Continue".

Upload the CSR file "xxx.certSigningRequest" created in section 1 (TXIMDemoAPS.certSigningRequest in this example) and click "Generate".

Now, you have finished creating the APS certificates. Click "Download" to save them locally (the development certificate is aps_development.cer, and the production certificate is aps.cer.)

Click "Done". The push state of this environment becomes "Enabled".

Note: the "Apple Push Notification service" column for some app IDs is grayed out and the "Configure" button is unavailable. This is because APNS does not support app IDs that contain wildcards.

Generating a Push Certificate

Import the certificate
Double-click the downloaded files in the previous section (aps_development.cer and aps.ce) to install them on your computer. In "Keychain Access", you can find the imported certificates.

Right-click the certificate and export it as a .p12 file. For example, save the certificate as TXIMDemoAPS.p12.

Note: development certificates are valid only for development in debug mode. Always use distribution certificates for production release.

Generating a Provisioning Profile (PP)

This section describes how to create a development provisioning profile. You can create a distribution provisioning profile by following the same process. First, click "Continue".

Select the App ID for which the push certificate was created in Step 3.3 and click "Continue".

Select the development certificate generated in Step 3.3 (or the distribution certificate in Step 3.3 when creating a distribution provisioning profile) and click "Continue".

Select the devices to be included into the testing of the app (distribution certificates do not require this step) and click "Continue".

Enter the name of the PP, which is IMDevPP in this example.

The PP is generated successfully.

Note: in all the preceding steps, no certificates, except the generated p12 certificate, need to be downloaded and installed locally.

Check the generated PP.
Verify that the state of the PP is "Active".

Click the PP to go to the details page and verify that its state is "Active".

Configuration in Xcode

The latest version of Xcode does not require the manual configuration of certificates and provisioning profiles. Instead, you only need to select the correct team in "General" and click "Fix Issue". This is why you do not need to download and install the generated certificates locally, as mentioned previously.