Setting Up iOS Push Notifications for Amazon Simple Notification Service (SNS)
| March 5, 2019 | in
iOS push notifications are often a requirement for mobile applications. But this feature isn’t easy to set up. It involves several steps across various applications, online and locally. And if you’re developing for multiple platforms (i.e., iOS and Android), you can be in for even more work.
But with Amazon’s Simple Notification Service (SNS), you have a slightly easier path.
Now this doesn’t mean that all of your difficulties are solved. When it comes to creating push notifications for iOS, you will be jumping into the fun world of certificates – and there’s just no way around that. I recently went through this hassle and documented my steps with the hopes it will help others.
Note that this is not the definitive document on navigating this complex process. These are the steps I used to set up push notifications for my project; I am not covering all possible scenarios here.
Log into Apple’s Developer site and register an App ID.
We need to create a certificate for our push notifications. In this example, we will expand the Push Notifications section and click “Create Certificate” in the Development SSL Certificate section.
Don’t close your browser. We will return to Apple’s Developer site shortly.
Next, we need to create the certificate signing request using the Keychain Access application on your Mac. From the Keychain Access menu, click “Certificate Assistant” and “Request a Certificate from a Certificate Authority”.
Now it’s time to upload the certificate. Return to Apple’s Developer site and upload the certificate we just created.
Now you are able to download the iOS push notification certificate.
After downloading the certificate, double click the .cer file. This will install it in the Keychain app. Then find the certificate in Keychain and right click on it and click “Export”.
Now you can import the p12 file into AWS SNS as an application.
After you get this configured, you can send push notifications through AWS’s SNS. In a later blog post, I’ll show how to use this setup to send notifications to a device using AWS Amplify / Ionic.
If you have any questions or comments, hit me up on Twitter or sound off in the comments below.