0

您好我正在尝试使用带有 PHP 开发工具包的 AWS Pinpoint 发送消息,但出现错误。任何想法为什么?这是我的代码:

    $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
4

1 回答 1

1

根据API Docs'MessageConfiguration'需要在'MessageRequest'字段内。请确保您的输入参数与记录的 API 参数语法完全匹配。

于 2018-02-16T23:12:36.777 回答