AWS SNS Notification Lighting

I have little doubt about sending SNS Push notifications. Please, with me, as I am new to AWS and PHP, and could not really get things easy.

1) I called this stackoverflow discussion where we can set the sound for APNS. But how do we do it for GCM?

2) How to set up a warning without sound ?

3) Is it possible to set a sound for each endpoint in PHP when they are created? I just want to know this so that when sending a message I can send messages with sound turned on and disabled when sending using topicARN.

4) I called this document to receive the delivery status of push notifications in the form of logs in cloudwatch. Is there any API for getting delivery status of those endpoints that were not received in PHP?

+6
source share
1 answer

For GCM, you can do the following:

$send = $sns->publish(array( 'TargetArn' => $EndpointArn, // to send notification to single user 'MessageStructure' => 'json', 'Message' => json_encode(array( 'default' => '', 'APNS' => json_encode(array( 'aps' => array( 'alert' => 'message to topic', 'sound'=> 'default', 'badge'=> 1 ), 'userid' => '1' )), 'GCM' => json_encode(array( 'data' => array( 'alert' => 'message to topic', 'userid' => '1' ), )) )) )); 

Do you want to create a custom sound alert for each arn endpoint?

For the 4th point, refer to the links:
1) http://docs.aws.amazon.com/sns/latest/dg/sns-msg-status.html?ref_=pe_411040_132389510

2) How to confirm delivery status when using amazonSNS mobile phone?

+1
source

All Articles