The first thing to do with the push service is to get the push certificate. It is used to identify your communication with apns through SSL.
Generate an SSL Certificate for Apple push notification on Mac:
-
- Log on to the iPhone developer connection portal and click app IDs.
-
- Create an app ID that does not use wildcards. The wildcard ID cannot be used for the push notification service. For example, our iPhone program id is like this: ab123127cd.com. serverdensity. iPhone
-
- Click "Configure" next to the app ID, and then press the button to generate the push notification license. Follow the steps in the Wizard to generate a signature, upload the signature, and finally download the generated license. This step is also described in the Apple documentation.
-
- Double-click the. Cer file to introduce your aps_developer_identity.cer to the keychain.
-
- Start the keychain assistant on Mac, and then select the certificates category in login keychain. You will see an extensible option "Apple development push services"
- Expand this option and right-click "Apple development push services"> export "Apple development push services id123 ". Save as a apns-dev-cert.p12 file.
-
- Extend Apple development push services to do the same for private key and save it as a apns-dev-key.p12 file.
-
- You need to use terminal commands to convert these files to the PEM format:
OpenSSL PKCS12-clcerts-nokeys-out apns-dev-cert.pem-In apns-dev-cert.p12 OpenSSL PKCS12-nocerts-out apns-dev-key.pem-In apns-dev-key.p12
-
- If you want to remove the password, do not set or execute it during export/conversion:
OpenSSL RSA-In apns-dev-key.pem-out apns-dev-key-noenc.pem
-
- Finally, you need to synthesize keys and license files into apns-dev.pem files that are used when connecting to apns:
Cat apns-dev-cert.pem apns-dev-key-noenc.pem> apns-dev.pem
Save this file as an easy-to-remember name that you may use later. The above steps are also suitable for generating product certificates.
Generate an apns PEM Certificate