dimanche 29 mars 2015

Amazon AWS SNS register application

Im trying to register an application using AWS SDK with the following code



$AmazonSNS = SnsClient::factory(array(
'key' => $sns_id,
'secret' => $sns_secret,
'region' => 'us-east-1'


));



$app_details = array(
'Name' => $app_name,
'Platform' => 'APNS',
'Attributes' => array(
'PlatformCredential ' => $pem, //PEM IS A STRING
'PlatformPrincipal' => ''
)
);

$results = $AmazonSNS->createPlatformApplication($app_details);


All I get is the following exception



<b>Fatal error</b>: Uncaught Aws\Sns\Exception\InvalidParameterException: AWS Error Code: InvalidParameter, Status Code: 400, AWS Request ID: 059d5491-75a5-5f7b-9183-190339511e06, AWS Error Type: client, AWS Error Message: Invalid parameter: Attributes Reason: Invalid attribute name: PlatformCredential , User-Agent: aws-sdk-php2/2.7.25 Guzzle/3.9.3 curl/7.38.0 PHP/5.5.22
thrown in <b>/home/notifications/public_html/Aws/Aws/Common/Exception/NamespaceExceptionFactory.php</b> on line <b>91</b><br />


My goal is to register an application to AWS for future use on sending notifications to the app users.


What is wrong with my code ?





Aucun commentaire:

Enregistrer un commentaire