【发布时间】:2018-05-12 06:42:46
【问题描述】:
我在将 Apple Wallet 的 Apple 推送通知与我的网络服务集成时遇到问题。
什么有效:
- 端点(如https://developer.apple.com/library/content/documentation/PassKit/Reference/PassKit_WebService/WebService.html 中所述);
- 通行证有效,可在 iPhone 上使用,注册、手动更新、取消注册等似乎都有效,我的服务器日志中没有错误;
- “Getting the latest Version of a Pass”端点的响应包含“Last-Modified”标头。
然后我在服务器上更新一个通行证。当我尝试发送推送通知时,没有任何反应。
我做了一些调试,APN 服务器 (https://api.push.apple.com:443) 返回代码 200,其正文为空且“apns-id”标头为非空。这看起来不错 (https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html)。
但是!我的 iPhone 上的 Wallet 中既没有通知也没有更新的通行证。
当我进行手动更新时,会显示通行证更新和更新通知。
我无法理解我做错了什么......
附:我使用 https://github.com/mdigger/apns 向 APNS 发出请求。
【问题讨论】:
-
您使用什么证书进行 APNS 连接?
-
我正在使用这个证书:Apple Push Services: [...];身份:Apple 推送服务:[...];验证人:Apple 全球开发者关系认证机构;过期:XX/XX/18
-
这是您的问题 - 您需要使用 Pass Type ID 证书连接到 APNS。
-
当我下载 Pass Type ID 证书时,它是 .cer - 但似乎我需要 PEM 用于 APNS?
标签: ios iphone apple-push-notifications passbook