I have few doubts regarding sending SNS Push Notifications. Please bare with me as I'm a newbie in both AWS and PHP and couldn't really get things easily.
1) I referred this stackoverflow discussion where we can set sound for APNS. But how we do it for GCM ?
2) How to configure no sound alert ?
3) Is it possible to set sound for each Endpoint in PHP while creating them ? I just want to know this so that while sending message I can send to those with sound enabled and to those disabled while sending it with topicARN.
4) I referred this document for getting the delivery status of push notification as logs in cloudwatch. Is there any API to retrieve the delivery status of those endpoints which failed to receive in PHP ?
1 Answers
Answers 1
For GCM, you can do like this:
$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 endpoint arn?
For 4th point refer this 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 push?
0 comments:
Post a Comment