How to use your own Amazon Simple Notification Service
Category: Sapho Server
Audience: System administrators installing and configuring Sapho Server
Sapho uses Amazon Web Services Simple Notification Service (AWS SNS) to send push notifications for both iOS and Android platforms. Follow this guide to set up and use your own SNS.
- Access to AWS SNS Console
- Access to the new Google API Console for Firebase Cloud Messaging
- Access to Apple Developer Center
- Access to Sapho Builder
- Access to the server where Sapho is deployed
1. Create a new SNS project for Android
- Log in to the AWS SNS Console. From the SNS dashboard, click Create platform application.
- Enter an application name and set the push notification platform to Google Cloud Messaging.
- To get the API key of your application, you need to create an API project for Firebase Cloud Messaging by following the steps outlined here.
- When you have finished registering the app in Firebase, go to Project Settings → Cloud Messaging. Copy the Server Key and Sender ID and paste them into a text file for future reference.
- Paste the Server Key in the API key input for the SNS project you started for Android and click Create platform application.
If you'd like to read more information, please check out Amazon's platform guide for Android: Getting Started with Google Cloud Messaging for Android.
2. Create a new SNS project for iOS
- Return to the SNS dashboard and click Create platform application. Enter an application name and set the push notification platform to Apple production.
- To obtain your app's push certificate and private key, follow the platform guide for iOS: Getting Started with Apple Push Notification Service.
- Upload the certificate, click Load credentials from file next to the password field, enter the private key, and click Create platform application.
3. Obtain the Amazon Resource Names (ARN) for you platform applications
4. Obtain security credentials (Access Key and Secret Key)
- Go to the AWS IAM Console and click on Users. Add a new user and set access type to Programmatic access. Select the newly created user and go to the Security Credentials tab. Click Create Access Key.
- Then choose Download Credentials to save the access key ID and secret access key to a CSV file on your computer. Store the file in a secure location for future reference. You will not have access to the secret access key again after this dialog box closes.
For more information, check out the AWS Documentation: Managing Access Keys.
5. Connect Sapho to AWS SNS
Here’s how to connect Sapho to AWS SNS and update the settings for push notifications in Sapho Builder. You'll need the credentials you obtained in the previous steps.
- Navigate to Settings → Events → Push Notifications
- Enter the Access Key and Secret Key for AWS.
- Enter the Android ARN and Android Sender ID.
- Enter the iOS ARN.
- Restart Sapho Server. Please note that this last step is very important in order for the new settings to work.