AWS SNS Push Notifications Guide
This guide provides detailed information on sending push notifications through AWS SNS.Prerequisites
Before sending push notifications, ensure you have:AWS Account
An active AWS account with SNS access
IAM Permissions
IAM user with appropriate SNS permissions
SNS Topic
An SNS topic configured for your application
Platform Application
Platform application in SNS (GCM for Android, APNS for iOS)
Message Payload Structure
The payload consists of two fields:The properly formatted notification payload (platform-specific)
The endpoint ARN for the target device
Platform-Specific Payloads
- Android (GCM/FCM)
- iOS (APNS)
Android Payload Fields
| Field | Description | Example |
|---|---|---|
title | Notification title | "New Message" |
body | Notification body text | "You have a new message" |
icon | Icon to display | "ic_notification" |
sound | Sound to play | "default" |
click_action | Action on click | "OPEN_ACTIVITY" |
data | Custom key-value pairs | {"key1": "value1"} |
priority | Message priority | "normal" or "high" |
ttl | Time to live | "3600s" (1 hour) |
Complete Field Reference
Android (GCM/FCM) Fields
title
title
Specifies the notification title displayed in the notification drawer.
body
body
Specifies the main content users see in the notification drawer.
icon
icon
Specifies the icon to display with the notification.
sound
sound
Specifies the sound to play when the notification arrives.
click_action
click_action
Defines the action to perform when the user clicks the notification.
data
data
Provides additional custom data to the application.
priority
priority
Sets the priority of the message. Valid values:
"normal" and "high".ttl
ttl
Time to live. Specifies how long the message should be kept if the device is offline.
iOS (APNS) Fields
aps.alert
aps.alert
Contains the notification’s title and body.
aps.badge
aps.badge
Sets the number to display on the app icon.
aps.content-available
aps.content-available
Indicates new content is available and can trigger background processing.
aps.category
aps.category
Used to define custom actions for the notification.
Usage in OsmoX
When sending push notifications through OsmoX:- Format the message payload according to the target platform
- Provide the correct endpoint ARN as the target
- OsmoX passes the message to AWS SNS for delivery