How to Generate an Apple Push Notification Service (APNs) Certificate
To send Push Notifications to the Apple Push Notification service (APNs), you need an Apple Push Notification service certificate.
In this article, we will explain how to generate an Apple Push Notification service (APNs) certificate using an Apple Developer Program account.
To generate an Apple Push Notification service certificate, you must be enrolled in the paid Apple Developer Program. For details, see About the Apple Developer Program.
Generate a CSR (Certificate Signing Request) on Mac
First, generate a CSR (Certificate Signing Request) on your Mac.
Open Keychain Access (you can find it using ⌘ command + space with Spotlight search).
In Keychain Access, select login in the default keychain in the upper left, Certificates in the categories at the top, and then select Apple Worldwide Developer Relations Certification Authority from the displayed certificates.
With that selected, go to the menu and choose [Keychain Access] > [Certificate Assistant] > [Request a Certificate From a Certificate Authority].
The Common Name should already be filled in. Enter your Apple ID email address in the User Email Address field, select “Saved to disk,” and click [Continue].
Choose a location to save the CSR file and click [Done]. Your CSR file is now created.
Generate an APNs Certificate in the Apple Developer Portal
Next, generate an APNs certificate.
Log in to the Apple Developer site, go to [Certificates, Identifiers & Profiles], and click Certificates.
On the Certificates, Identifiers & Profiles page, click the + button on the right side of Certificates.
On the Create a New Certificate page, under Services, select Apple Push Notification service SSL (Sandbox & Production), then click [Continue].
Select the App ID you created earlier in How to Create an App ID for Push Notifications, then click [Continue].
Click [Choose File], select the CSR file you just created, and then click [Continue].
Your Apple Push Notification service certificate is now generated. Click [Download] to download it.
Install the APNs Certificate on Your Mac
Now, install the Apple Push Notification service certificate on your Mac.
Double-click the downloaded .cer file. Keychain Access will open, and the certificate will be installed automatically.
If the certificate is not trusted, open it in Keychain Access, expand the Trust section, and change it to “Always Trust.”
That's all for how to generate an Apple Push Notification service certificate for iOS.