【问题标题】:How to debug if the message went through Apple Push Notification Service?如果消息通过 Apple 推送通知服务,如何调试?
【发布时间】:2012-10-17 17:55:16
【问题描述】:

我正在尝试使用 node.js 作为服务器的 Apple 推送通知服务。到目前为止,我已经让它工作了,当它工作时,它会按预期工作。

但是,有时消息没有到达。我不确定这是否是自然的(也许我的连接不好,因此消息没有通过),或者它是否是我的代码中的错误。情况真的很随机​​。有时它会通过,有时它不会,即使我没有更改代码或任何东西。

我正在使用 node-apn (https://github.com/argon/node-apn),根据调试控制台,它被注册为成功通过 - 至少从服务器端。这是调试消息:

apn Initialising connection +19s
apn Initialising module +1ms
apn Connection established +383ms
apn Sending notification +0ms
apn Socket drained +1ms
apn Socket writeable +0ms

此消息在消息通过和未通过时都会出现。所以我猜 node-apn 本身做得很好。这意味着它是:

  1. 我的服务器和苹果推送服务器之间发生了一些事情
  2. Apple 推送服务器和我的 iOS 设备之间发生了问题

但我不知道如何找出发生了什么。所以我想要找到的解决方案是:

  1. 查看我的推送通知是否被 APNS 注册
  2. 查看 APNS 是否正在向我的 iDevice 发送所有通知

有人知道怎么做吗?非常感谢!

【问题讨论】:

    标签: ios node.js push-notification apple-push-notifications


    【解决方案1】:

    在端口 2195、2196 和 5223 上使用 tcpdump,因为数据会通过它们: http://support.apple.com/en-us/HT202944

    使用 Wireshark 读取转储文件: http://redmine.streamco.org/projects/smartswitch-public/wiki/Debug_VoIP_call_with_Wireshark

    【讨论】:

      【解决方案2】:

      Apple 有一篇写得很好的技术说明,介绍了推送通知服务的不同问题来源: http://developer.apple.com/library/ios/#technotes/tn2265/_index.html

      【讨论】:

        猜你喜欢
        • 2016-09-21
        • 1970-01-01
        • 2010-11-24
        • 1970-01-01
        • 1970-01-01
        • 2017-11-18
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多