我在我的項目上實施了AWS SNS,我試圖使用AWS SNS服務向Android和iOS設備發送推送通知,但是我沒有獲得適當的文檔來逐步實施。AWS SNS在laravel-4上實現
我的代碼如下
$aws = Aws::factory(array(
'profile' => 'my_profile',
'region' => 'us-east-1',
'key' => Config::get('app.aws_access_key'),
'secret' =>Config::get('app.aws_secret_access_key')
));
$this->sns = $aws->get('Sns');
$task = $this->sns->publish(
array(
'TargetArn' => 'arn:aws:sns:us-east-1:341707006110:My-topic',
'Message' => 'Hello from PHP',
'Subject' => 'Hello world!'
));
我收到以下錯誤:
User: arn:aws:iam::341707006110:user/my-topic is not authorized to perform
我有一個像「APA91bGUAbXanTXExEtDpr9XfZE8leNJtB3V」的設備令牌,我想在此設備上發送推送通知。我如何將設備令牌傳遞給publish()方法?
你可以給完整的錯誤堆棧嗎? – Rohit