Send SNS push notifications painlessly.
$ brew install creasty/tools/aws-sns-push
$ 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
$ 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
$ cat | jq '{ APNS: (. | tojson) }' | aws-sns-push -y sample-prod/12345
{
"aps": {
"alert": {
"title": "Hello from aws-sns-push",
"body": "This is awesome"
}
}
}
^D