I am facing issue with SNS endpoint getting disabled when I make a call to SNS server. For debugging I added logs. In logs it is showing true and in Amazon SNS it is showing false. Please help me how to handle the situations
Following is the code I am writing for setting the endpoint Atrributes.
$enable_end_point = $client->setEndpointAttributes(array(
'Endpoenter code hereintArn' => $pushlist[$i]['aws'],
'Attributes' => array(
'Enabled' => 'true'
)`enter code here`
));
Log response I am getting from Amazon SNS server
data: get paramsGuzzle\Service\Resource\Model Object(
[structure:protected] =>
[data:protected] => Array
(
[Attributes] => Array(
[Enabled] => true
[Token] => xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
)
[ResponseMetadata] => Array(
[RequestId] => 1ef66366-6dc3-549a-8d38-2d4a5axxxxx
)
)
)
Publishing the notification
$result = $client->publish(array(
'TargetArn' => $pushlist[$i]['aws'],
'Message' => $msg_json,
'Subject' => 'New xxxxx',
'MessageStructure' => 'json',
));
Publish log:
data: publish resultGuzzle\Service\Resource\Model Object
(
[structure:protected] =>
[data:protected] => Array
(
[MessageId] => 5bbeb85f-75e7-5967-a55a-f673424xxxxx
[ResponseMetadata] => Array
(
[RequestId] => 5c7f3df2-ff65-5bb5-a74a-73dec8cxxxxx
)
)
)
After publish I am checking the endpoint status through logs
data: get params after publishGuzzle\Service\Resource\Model Object
(
[structure:protected] =>
[data:protected] => Array
(
[Attributes] => Array
(
[Enabled] => true
[Token] => xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
)
[ResponseMetadata] => Array
(
[RequestId] => f3bdbb0d-9666-5b38-84a0-f521a1cxxxxx
)
)
)
In the above response I am getting endpoint status as true. But I am not getting any push notifications and on Amazon SNS status is showing as false.
Regards,
Vamsi
Aucun commentaire:
Enregistrer un commentaire