Laravel AWS PHP SDK - CreatePlatformEndpoint抛出400 Bad Request

时间:2016-08-15 10:12:43

标签: php amazon-web-services amazon-sns

我正在使用" aws / aws-sdk-php-laravel":" ~3.0"

当我尝试注册Android设备时,它会抛出错误。 以下是它的快照。

enter image description here

我尝试了两种不同的代码格式,但两者都有相同的例外。

  $device = 'gcm_id_here';

  $sns = App::make('aws')->createClient('sns');
  $result = $sns->createPlatformEndpoint(['Token' => 'device_unique_id',
                                'PlatformApplicationArn' => $device]);

  // or

  $credentials = new Credentials('key', 'secret');
  $client = new SnsClient([
      'version'     => 'latest',
      'region'      => 'us-west-2',
       'credentials' => $credentials
  ]);

  $SNSEndPointData = $client->createPlatformEndpoint([
     'PlatformApplicationArn' => $device,
     'Token' => 'device_unique_id'
  ]);

请帮我解决这个问题。

0 个答案:

没有答案