【问题标题】:Silent push notification not working in ios 13静默推送通知在 ios 13 中不起作用
【发布时间】:2019-09-26 07:04:51
【问题描述】:

静默通知在 iPad 13 操作系统中不起作用。但是,在 12.4 操作系统中它可以正常工作。

这是我从服务器发送的有效负载

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

想知道为什么会这样吗?

【问题讨论】:

标签: ios


【解决方案1】:

添加“apns-push-type”标头字段解决了这个问题。请注意,这是一个 APNS POST 请求标头字段,而不是推送 JSON 中的新键。

【讨论】:

    【解决方案2】:

    “apns-push-type”在向运行 iOS 13 及更高版本或 watchOS 6 及更高版本的设备发送通知时是必需的。在较早的系统版本上被忽略。 Apple document APNS Silent push notification.

    【讨论】:

      【解决方案3】:

      从邮递员那里试试这个。它为我工作

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2013-10-14
        • 1970-01-01
        • 2020-01-31
        • 2014-01-14
        • 2018-12-05
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多