cliから
arn="arn:aws:sns:ap-northeast-1:xxxxx:app/APNS_SANDBOX/XXXX"
device_token="7746672f9de13....."
aws sns create-platform-endpoint \
--platform-application-arn $arn \
--token $device_token
PHP SDKから
<?php
$aws = Aws::factory(__DIR__.'/config.php');
$sns = $aws->get('Sns');
$arn = "arn:aws:sns:ap-northeast-1:xxxxx:app/APNS_SANDBOX/XXXX";
$device_token = "7746672f9de13.....";
$result = $sns->createPlatformEndpoint([
'PlatformApplicationArn' => $arn,
'Token' => $device_token,
'CustomUserData' => 'userdata!',
'Attributes' => ['Enabled' => 'true']
]);
$request_id = $result->getPath('ResponseMetadata/RequestId');
$endpoint_arn = $result->getPath('EndpointArn');
// or $result->toArray();
参考
Amazon Simple Notification Service
http://docs.aws.amazon.com/aws-sdk-php/guide/latest/service-sns.html