简体   繁体   English

静默推送通知在 ios 13 中不起作用

[英]Silent push notification not working in ios 13

Silent notification is not working in iPad 13 OS.静默通知在 iPad 13 操作系统中不起作用。 But, in 12.4 OS it is working fine.但是,在 12.4 操作系统中它工作正常。

This is the payload I send from my server这是我从服务器发送的有效负载

{
    "aps": {
       "content-available" : "1"
    },
  "BuildingId":13,
 "NotificationTypeId":214,
 "CustomerName":"Test",
 "Amount":"6778",
 "CustomerID":32752,
"Environment":"TEST",
 "Title":""
}

Any wonder why this happens?想知道为什么会这样吗?

Adding "apns-push-type" header field solved the issue.添加“apns-push-type”header 字段解决了这个问题。 Please note this is a APNS POST request header field, not a new key in push JSON.请注意,这是一个 APNS POST 请求 header 字段,而不是推送 JSON 中的新键。

"apns-push-type" is Required when delivering notifications to devices running iOS 13 and later, or watchOS 6 and later.向运行 iOS 13 及更高版本或 watchOS 6 及更高版本的设备发送通知时,“apns-push-type”是必需的。 Ignored on earlier system versions.在较早的系统版本上被忽略。 Apple document APNS Silent push notification . Apple 文档 APNS 静默推送通知

try this from postman.从 postman 试试这个。 its work for me它为我工作

{ 
"to":"token", 
    "content_available":true,
    "mutable_content": true,
    "data": {
        "message": "Offer!",
        "urlImageString":"https://res.cloudinary.com/demo/image/upload/sample.jpg",
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM