AWS-PHP-SDK / SNS直接寻址返回错误 [英] AWS-PHP-SDK / SNS direct addressing returns error

查看:352
本文介绍了AWS-PHP-SDK / SNS直接寻址返回错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Laravel 4的设置充分利用AWS的SNS发送推送消息给我的iOS设备,发布命令,我的设备从AWS控制台效果很好。

Hi I am using Laravel 4 setup to make use of AWS SNS to send a push message to my iOS device, the publish command to my device works well from AWS console.

然后我从PHP尝试:

    $sns = AWS::get('sns');

    $sns->publish(array(
        'Message' => 'Hello from PHP',
        'TargetArn' => "arn:aws:sns:us-west-2:360542326270:endpoint/APNS_SANDBOX/Testtest/20a75cd1-da25-3331-8126-4db497cbdd5e"
    ));

我收到

Guzzle \ Service \ Exception \ ValidationException Validation errors: [TopicArn] is a required string: The topic you want to publish to.

但该文档具体说了,我可以使用发布到或者发送到主题ARN,或者使用直接寻址发送给直接一个单一的设备。

but the docs specifically say I can use publish to either send to a topic ARN or use direct addressing to send to a single device directly.

看来AWS PHP SDK强迫我使用TopicArn反正。

it seems the AWS PHP SDK forces me to use TopicArn anyway.

<一个href="http://aws.typepad.com/aws/2013/08/push-notifications-to-mobile-devices-using-amazon-sns.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+AmazonWebServicesBlog+%28Amazon+Web+Services+Blog%29" rel="nofollow">http://aws.typepad.com/aws/2013/08/push-notifications-to-mobile-devices-using-amazon-sns.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+AmazonWebServicesBlog+(Amazon+Web+Services+Blog)

我是什么做错了吗?

推荐答案

我只是删除作曲家明确狂饮线。然后跑了更新,它删除狂饮3.6并安装3.9。它然后取出AWS-PHP-SDK 2.3.4并安装DEV-主

I just removed the explicit guzzle line from composer. then ran update, it removed guzzle 3.6 and installed 3.9. it then removed AWS-PHP-SDK 2.3.4 and installed dev-master

然后我尝试过了,它的工作。

I then tried it and it worked.

不知道是什么问题,但不同的软件包的版本并没有一起工作......

not sure what was the problem, but different packages versions did not work together...

这篇关于AWS-PHP-SDK / SNS直接寻址返回错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆