最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

aws sdk - SNS sending CreateTopicCommand I got Invalid parameter: DataProtectionPolicy Reason: Failed to parse the data protecti

programmeradmin2浏览0评论

I created on aws a "Push notification platform - Apple iOS (development)"

I am just trying to create a new endpoint from AWS SDK JS v3

    const deviceId = 'a0b1c2d3e4f5' // would be a real deviceId
    const createEndpointResponse = await client.send(
        new CreatePlatformEndpointCommand({
            PlatformApplicationArn: platformArn,
            Token: deviceId,
        })
    )
    const createTopicResponse = await client.send(
        new CreateTopicCommand({
            DataProtectionPolicy: 'STRING_VALUE',
            Name: 'PushNotificationTestTopic',
        })
    )
    console.log('Device-specific topic ARN', createTopicResponse.TopicArn )
    const topicArn = createTopicResponse.TopicArn

I get this error

{"errorType": "InvalidParameterException", "errorMessage": "Invalid parameter: DataProtectionPolicy Reason: Failed to parse the data protection policy"

I created on aws a "Push notification platform - Apple iOS (development)"

I am just trying to create a new endpoint from AWS SDK JS v3

    const deviceId = 'a0b1c2d3e4f5' // would be a real deviceId
    const createEndpointResponse = await client.send(
        new CreatePlatformEndpointCommand({
            PlatformApplicationArn: platformArn,
            Token: deviceId,
        })
    )
    const createTopicResponse = await client.send(
        new CreateTopicCommand({
            DataProtectionPolicy: 'STRING_VALUE',
            Name: 'PushNotificationTestTopic',
        })
    )
    console.log('Device-specific topic ARN', createTopicResponse.TopicArn )
    const topicArn = createTopicResponse.TopicArn

I get this error

{"errorType": "InvalidParameterException", "errorMessage": "Invalid parameter: DataProtectionPolicy Reason: Failed to parse the data protection policy"

Share Improve this question asked Jan 30 at 17:02 realteborealtebo 25.7k45 gold badges126 silver badges216 bronze badges 1
  • This may be unrelated to this specific API call, the DataProtectionPolicy is part of the SNS Topic, maybe something is messed up there and it validates it while you create the platform endpoint. – Maurice Commented Jan 31 at 16:46
Add a comment  | 

1 Answer 1

Reset to default 0

I ended removing

"DataProtectionPolicy: 'STRING_VALUE',"

it now works

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论