我编码像
$sns = App::make('aws')->createClient('sns');
$data = json_encode([
'APNS' => ['apns' => [
'alert' => $message
]
]
]);
Log::info($data);
$sns->publish(array(
'Message' => $data,
'TargetArn' => "arn:aws:sns:us-west-2:360542326270:endpoint/APNS_SANDBOX/Testtest/20a75cd1-da25-3331-8126-4db497cbdd5e"
));
我收到如下错误:
[Aws\Sns\Exception\SnsException]
在“ https://sns.us-east-1.amazonaws.com ”上执行“发布”时出错;AWS HTTP错误:客户端错误:POST https://sns.us-east-1.amazonaws.com
导致400 Bad Request
响应:
<Type>Sender</Type>
<Code>InvalidPara (truncated...)
InvalidParameter(客户端):无效参数:TargetArn原因:未找到指定目标arn的端点-
<Type>Sender</Type>
<Code>InvalidParameter</Code>
<Message>Invalid parameter: TargetArn Reason: No endpoint found for the target arn specified</Message>
<RequestId>18937e90-5453-5e30-bf89-315a59c3f2af</RequestId>
[GuzzleHttp \ Exception \ ClientException]
客户端错误:POST https://sns.us-east-1.amazonaws.com
导致400 Bad Request
响应:
<Type>Sender</Type>
<Code>InvalidPara (truncated...)
谁能帮我找到解决方案?提前致谢..
我已通过以下链接使用AWS账户密钥和config / aws.php文件中的密钥更新了配置文件https://github.com/aws/aws-sdk-php-laravel
。这样,它就可以工作了。以前,我已经在.env文件中进行了更新。现在,它运作良好。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句