[英]How to send the High priority push notification through AWS SNS
我們需要使用 Amazon SNS 服務將高優先級推送通知發送到手機 android。
我們能夠發送正常的優先級消息,但我們不能在消息中包含優先級屬性。
謝謝
它的記錄很少,但這是它的工作原理。
確保幾件事情到位:
Python 示例如下所示
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',
)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.