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
Share Improve this question asked Jan 30 at 17:02 realteborealtebo 25.7k45 gold badges126 silver badges216 bronze badges 1{"errorType": "InvalidParameterException", "errorMessage": "Invalid parameter: DataProtectionPolicy Reason: Failed to parse the data protection policy"
- 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
1 Answer
Reset to default 0I ended removing
"DataProtectionPolicy: 'STRING_VALUE',"
it now works