Apple Push Notifications With Amazon SNS
- Go to AWS console and locate the SNS service.
- Click on the Applications menu to register a new app for push notifications.
- Click Create platform application button.
- Next, Login into apple developer portal and click Certificates, Identifiers and Profiles.
- Under the Identifiers menu on the left sidem click Apps IDs
- Find the right bundle id and click on it to get to the details.
- Click on the Edit button to reveal the full details.
- Download the production certificate
- The download file extension is cer, but we need to convert it to a p12 file for AWS
- This conversion requires a mac, so copy the file over by whatever means necessary.
- Double click the cer file and it should open it up in keychain as shown above.
- Rt click on the certificate (not the private key, its important) and export to p12
- Optionally set a secure password as part of the export.
- Upload the p12 file in the create platform application dialog (Step 2)
- Fill in the same password you set at the time of export in case there was a passwod. I left it blank for the sake of this demo.
- Now p12 is binary file that contains the certificate info and the private key info that we need for the next two textboxes on this dialog. For that we need to convert p12 to a pem file that is human readble.
- Run the following command on the mac to do this conversion.
openssl pkcs12 -in dev.p12 -out dev.pem -nodes
- Rt click on the pem fie and open with VSCode or any other text editor and copy the certificate and private key info to paste into the create platform application dialog.
- Copy everything between BEGIN and End Certificate section, delimeters including.
- Same for the private key
- Finally click the Create platform application button and the endpoint is ready to test.