How to use your own Amazon Simple Notification Service

Last update:

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.

Requirements

 

1. Create a new SNS project for Android

  • Log in to the AWS SNS Console. From the SNS dashboard, click Create platform application.Screen_Shot_2017-05-11_at_16.56.21.png
  • Enter an application name and set the push notification platform to Google Cloud Messaging.Screen_Shot_2017-05-11_at_16.58.29.png
  • 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 SettingsCloud Messaging. Copy the Server Key and Sender ID and paste them into a text file for future reference.GCM-Setup.png
  • 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.Screen_Shot_2017-05-11_at_16.58.00.png
  • 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

In the AWS Console, go to Applications. Copy the ARN values for your Android and iOS projects and paste them into a text file for future reference.arns.png

 

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 KeyAWS_IAM_Console.png
  • 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.

Sapho-Global-Settings-Push.png