Reputation: 6675
How can I verify my AWS SNS credentials for APNS in production? I needed to update the credentials (public/private key) because the original certificate is expiring, now I want to test sending a push notification to a single device so that I don't spam every user with a test push notification.
Upvotes: 0
Views: 1478
Reputation: 6675
First you need to determine the SNS ARN for the specific device you want to send a push notification to, usually this can be done by inspecting the network traffic of the app with Charles Proxy. Look for a request to sns.us-east-1.amazonaws.com
and find the EndpointArn attribute in the request that contains a guid after your SNS Application Name:
Then you can trigger the push notification using the AWS CLI command below, replacing the target-arn
option with the EndpointArn determined from the previous step.
aws sns publish --target-arn "arn:aws:sns:us-east-1:<aws account id>:endpoint/APNS/<sns application name>/<device guid>" --message "test"
Other tips:
target-arn
argument.Upvotes: 2