We need to send the high priority push notification to android mobile using Amazon SNS service.
We are able to send the normal priority messages, but we could not include the priority attribute in the message.
Thank you
We need to send the high priority push notification to android mobile using Amazon SNS service.
We are able to send the normal priority messages, but we could not include the priority attribute in the message.
Thank you
It is poorly documented but here is how it worked out.
Make sure several things are in place:
Python example would look like this
sns: SNSClient = boto3.client('sns', region_name='us-east-1')
message = json.dumps(
{
"default": json.dumps(
{
"priority": "high",
"data": {"my": "custom", "payload": "here"},
"notification": {
"title": "Ukraine is awesome",
"body": "Ukraine is awesome",
},
}
),
"GCM": json.dumps(
{
"priority": "high",
"data": {"my": "custom", "payload": "here"},
"notification": {
"title": "Ukraine is awesome",
"body": "Ukraine is awesome",
},
}
),
}
)
response = sns.publish(
TopicArn=SNS_TOPIC,
Message=message,
MessageStructure='json',
)