In this article, we will learn the following things.
AWS SNS Notification
- What is AWS?
- Create SNS application Platform
- Create SNS Topic
- Add the SNS Permission
What is AWS?
Amazon Web Services (AWS) is the world’s most comprehensive and broadly adopted cloud platform, offering over 200 fully-featured services from data centers globally. Millions of customers—including the fastest-growing start-ups, largest enterprises, and leading government agencies—are using AWS to lower costs, become more agile, and innovate faster.
Click here and go to the AWS account portal then click on the upper right corner button that is Sign In to the console.
After logging in into the AWS account, click on Simple Notification Service
Select Push-Notification
Create the platform for iOS and Android.
Create Android Platform
Now, first, we create an android platform.
- Enter the platform application name
- Select the FCM in Push-Notification-platform Section
- Enter the FCM project API key, which is provided by the FCM console.
For tracking the delivery status we need to add the IAM role if it is not there then directly create from create new role button.
When clicking on create a new role, a new dialog appears to give the Allow permission.
Then click on Create platform application. Here is the android platform created.
Create iOS Platform
Now we will create the iOS platform, so first
- Enter the platform application name
- Select the apple iOS/VoIP/MacOS in Push-Notification-platform Section.
- Uncheck if you used it for development in the sandbox.
- Select the certificate radio button.
- Choose file and select the APNS certificate and click OK.
- Enter the certificate password and click load credentials from file.
Here we again create a role for tracking the push notification status. And then click on Create platform application
Go back and here you can see both platforms ios-prod-platform-1 and android-prod-platform-1.
Create SNS Topic
Now we are creating the topic so we came back to the SNS dashboard then click on Create Topic.
After clicking create topic, the new page appears where we select the standard topic type and enter the topic name and Display name then click on create topic.
So we create one or more topics required for our app.
Permission / Access
Here we set the SNS permission for the Push-Notification-API.
First search the IAM user in the search box then click on it.
After that, I have to click on the user and click on a user.
Then click on Add permission then navigate to the permission list
Here we search and select the default permission and also customize permission which we can create in Policies Section.
That's it, now you can use the platform ARN and create the end-point and publish the notifications.