Direct Addressing AWS-PHP-SDK / SNS returns an error

Hi, I am using the Laravel 4 setup to use AWS SNS to send push messages to my iOS device, the publish command on my device works well with the AWS console.

Then I tried 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" )); 

I get

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

but the docs say that I can use the publication to send topics to ARN or use direct addressing to send directly to one device.

it seems that the AWS PHP SDK makes me use TopicArn anyway.

http://aws.typepad.com/aws/2013/08/push-notifications-to-mobile-devices-using-amazon-sns. HTML utm_source = FeedBurner &? utm_medium = feed & utm_campaign = stream% 3A + AmazonWebServicesBlog + (Amazon + Web + Services + Blog)

what am I doing wrong?

+2
source share
1 answer

I just deleted the explicit guzzle line from the composer. then performed the update, he uninstalled guzzle 3.6 and installed 3.9. He then uninstalled AWS-PHP-SDK 2.3.4 and installed dev-master

Then I tried and it worked.

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

+2
source

All Articles