Skip to content

Send SNS push notifications painlessly from terminal

License

Notifications You must be signed in to change notification settings

creasty/aws-sns-push

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aws-sns-push

Build Status GoDoc GitHub release License

Send SNS push notifications painlessly.

Installation

$ brew install creasty/tools/aws-sns-push

Usage

$ aws-sns-push
Send SNS push notifications painlessly.

USAGE:
    aws-sns-push [OPTIONS] TARGET

TARGET:
    1. {application-name}/{user-id}
       e.g., sample-prod/12345

    2. {application-name}/{device-token}
       e.g., sample-prod/ffffff

    3. {endpoint-arn}
       e.g., arn:aws:sns:ap-northeast-1:0000:endpoint/APNS/sample-prod/ffffff

OPTIONS:
    -y    Send without confirmation
    -v    Show version
    -h    Show help

Send

$ aws-sns-push sample-prod/12345
==> Endpoints
- arn:aws:sns:ap-northeast-1:000000000000:endpoint/APNS/sample-prod/ffffffff-ffff-ffff-ffff-ffffffffffff
==> Enter JSON message (Ctrl-D)
{
  "APNS": "{\"aps\":{\"alert\":{\"title\":\"Hello from aws-sns-push\",\"body\":\"This is awesome\"}}}"
}
> Proceed to send [y] y

Advanced usage with jq

$ cat | jq '{ APNS: (. | tojson) }' | aws-sns-push -y sample-prod/12345
{
  "aps": {
    "alert": {
      "title": "Hello from aws-sns-push",
      "body": "This is awesome"
    }
  }
}
^D