AWS SNS推送通知澄清


AWS SNS push notification clarification

我对发送SNS推送通知没有什么疑问。

1) 我提到了这个stackoverflow讨论,我们可以为APNS设置声音。但是我们如何为GCM做到这一点呢?

2) 如何配置无声音警报?

3) 在创建端点时,是否可以在PHP中为每个端点设置声音?我只想知道这一点,这样在发送消息时,我可以发送给那些启用了声音的人,也可以发送给使用topicRN发送消息时禁用的人。

4) 我参考了这个文档,以便在cloudwatch中获得推送通知的交付状态作为日志。是否有任何API可以检索那些在PHP中接收失败的端点的交付状态?

对于GCM,您可以这样做:

$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'
                                ),
                            ))
                        ))
                ));

是否要为每个端点arn创建自定义声音警报?

有关第4点,请参阅以下链接:
1)http://docs.aws.amazon.com/sns/latest/dg/sns-msg-status.html?ref_=pe_411040_132389510

2) 使用亚马逊SNS手机推送时如何确认发货状态?