钱包中的 Apple Pass 不会在推送通知时更新

Apple Passes in Wallet don't update on push notifications

我在将 Apple 钱包的 Apple 推送通知与我的 Web 服务集成时遇到问题。

什么有效:

然后我在服务器上更新一个通行证。当我尝试发送推送通知时,没有任何反应。

我做了一些调试,APN 服务器 (https://api.push.apple.com:443) returns code 200 with an empty body and non-empty "apns-id" header. This looks OK (https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html)。

但是!我的 iPhone 上的钱包既没有通知也没有更新通行证。

当我进行手动更新时,通行证更新并显示更新通知。

我不明白我做错了什么...

P.S。我使用 https://github.com/mdigger/apns 向 APNS 发出请求。

连接到 APNS 以进行钱包更新时,您需要连接用于签署通行证的同一通行证类型 ID 证书。

参见部分:

Your Server Sends a Push Notification When Something Changes

wallet documentation.

Your server sends the following pieces of information:

  • The pass type identifier (in the certificate)
  • The push token (in the communication to the Apple Push Notification service)