您好,我正在尝试发送消息使用AWS Pinpoint与PHP SDK,但我得到了一个错误。你知道为什么吗?下面是我的代码:
$client = new PinpointClient([
'version' => 'latest',
'region' => 'us-east-1',
'credentials' => [
'key' => 'MYIAMAWSKEY',
'secret' => 'MYAWSSECRET',
]
]);
$result = $client->sendMessages([
'ApplicationId' => 'MyAppId',
'MessageRequest' => [
'Addresses' => [
'AnIOSDeviceToken' => [
'BodyOverride' => 'aaa',
'ChannelType' => 'APNS',
'RawContent' => 'bbb',
'Context' => ['ccc' => '222'],
'TitleOverride' => 'ddd',
],
],
],
'MessageConfiguration' => [
'APNSMessage' => [
'Action' => 'OPEN_APP',
'Body' => 'Hello',
'RawContent' => 'World',
'SilentPush' => false,
'Title' => 'Hello World!!!',
],
],
]);我得到以下错误:
DeliveryStatus: 'PERMANENT_FAILURE'
StatusCode: 400
StatusMessage: Invalid notification: Notification is malformed发布于 2018-02-17 07:12:37
根据the API Docs的说法,'MessageConfiguration'需要在'MessageRequest'字段内。请确保您的输入参数与文档中的API参数语法完全匹配。
https://stackoverflow.com/questions/48834984
复制相似问题