【问题标题】:AWS SNS push notification clarificationAWS SNS 推送通知说明
【发布时间】:2016-07-12 06:31:03
【问题描述】:

我对发送 SNS 推送通知毫无疑问。

1) 我提到了thisstackoverflow 讨论,我们可以在其中为 APNS 设置声音。但是我们如何为 GCM 做呢?

2) 如何设置无声音提示?

3) 是否可以在 PHP 中为每个 Endpoint 设置声音,同时创建它们?我只是想知道这一点,以便在发送消息时我可以发送给启用声音的人以及在使用 topicARN 发送消息时禁用的人。

4) 我参考了this 文档,用于获取推送通知的传递状态作为 cloudwatch 中的日志。是否有任何 API 可以检索那些在 PHP 中接收失败的端点的传递状态?

【问题讨论】:

  • 您想为每个端点 arn 创建自定义声音警报吗?

标签: php amazon-web-services amazon-sns


【解决方案1】:

对于 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 创建自定义声音警报吗?

对于第四点,请参考以下链接:
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?

【讨论】:

  • 像 APNS 一样,我们没有为 GCM 设置任何内容。如果我不想设置任何声音怎么办?
  • @Reaching-Out 声音处理来自 Android 端。
  • @Reaching-Out ok.. 你觉得有用吗?
  • 没有。我已经尝试了所有这些文件并设计了自己的方法。但我正在寻找的还是一个直截了当的解决方案。
  • @Reaching-Out 声音通知将仅从设备管理
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-05-25
  • 1970-01-01
  • 2015-09-28
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多