在哪里为 iOS 13 的推送通知配置 Header 字段?

Where to do Header fields configurations for Push Notification for iOS 13?

根据 Apple's APNs docs,从 iOS 开始,http api 的 13 个客户端必须为 apns-push-type 和 apns-priority 发送 header 字段否则请求将失败。

果然,我们更新到 iOS 13 测试版的用户没有收到我们通过 Pushwoosh

发送的静默推送通知

在我的代码级别(在我的 Xcode 中)进行了所有必要的更改。

现在唯一悬而未决的是 2 header 必须添加负载。 (Here is the article)

  1. 第一个 attribute/parameter 到 header 的 APNS 负载:apns-push-type

    (Key: apns-push-type and Value: alert or background)

  2. 第二个 attribute/parameter 到 header 用于 APNS 有效负载:apns-priority

    (Key: apns-push-type and Value: alert or background)

必须在这 2 个 header 字段中添加值?

来自后端数据库或 PushWhoosh ?

还是我的代码水平?

有人可以帮忙吗?

因为上面写着,

“向设备 运行 iOS 13 发送通知时需要这些 header”。此外,“如果 header 在所需系统上丢失,APNs 可能会延迟通知的传递或完全放弃它。”

有关更多信息,请参阅以下文章,

iOS 13 and Xcode 11 Changes That Affect Push Notifications

Sending Notification Requests to APNs

这是 Pushwoosh 团队,

提供的信息

First of all, it should be emphasised that we took the necessary actions on our side before the release of the iOS 13 to avoid issues with silent pushes.

Regarding the apns-priority parameter, please note that our sender always includes this parameter for iOS silent pushes by default. So it is not necessary to add it by yourself.

As for the apns-push-type parameter, it was introduced with iOS 13. It is required for pushes to watchOS and is not required(for now) for pushes to iOS. This parameter does not add any "tricky" behaviour for push notifications. This is also described in the Apple article you have provided.

这是我的邮件截图,

因此,无需进行您要求的更改。