【发布时间】:2019-09-26 14:58:23
【问题描述】:
从 iOS 13 和 watchOS 6 开始,Apple 要求存在标头 apns-push-type(此标头的值可以是 alert 或 background)用于推送通知。
根据 Apple 文档:
此标头的值必须准确反映通知负载的内容。如果不匹配,或者所需系统上缺少标头,APN 可能会延迟通知的传递或完全放弃通知。
HEADERS
- END_STREAM
+ END_HEADERS
:method = POST
:scheme = https
:path = /3/device/xxxxxx
host = api.sandbox.push.apple.com
authorization = bearer xxx
apns-id = xxx-xxx-xxx
apns-push-type = alert
apns-expiration = 0
apns-priority = 10
apns-topic = com.example.MyApp
DATA
+ END_STREAM
{ "aps" : { "alert" : "Hello" } }
不幸的是,使用 azure 通知中心我只能定义 apscontent 而不能定义标题。
{ "aps": { "alert":"Alert message!", "content-available": 1 }, "CustomData": "$(CustomData)" }
Azure 通知中心如何处理它? 如何指定通知的类型?
【问题讨论】:
标签: azure push-notification ios13 azure-notificationhub