I am experimenting with Apple Push Notification Service with node.js as server. So far I've got it to work and when it works, it works as intended.
However, sometimes the message doesn't arrive. I am not sure if this is natural (maybe I have bad connection and the message is not coming through because of that), or if it's a bug in my code. The situation is really random. Sometimes it comes through and sometimes it doesn't, even though I didn't change the code or anything.
I am using node-apn (https://github.com/argon/node-apn), and according to the debug console, it's being registered as successfully going through--at least from the server side. Here's the debug message:
apn Initialising connection +19s
apn Initialising module +1ms
apn Connection established +383ms
apn Sending notification +0ms
apn Socket drained +1ms
apn Socket writeable +0ms
This message appears both when the message goes through and when it doesn't go through. So I guess node-apn itself is doing its job all right. Which means it's either:
But I don't know how to find out what's happening. So what I am trying to find is a solution to:
Anyone know how to do this? Thank you so much!
There is a well written technical note from Apple about the different sources of problems with the push notification services: http://developer.apple.com/library/ios/#technotes/tn2265/_index.html
Use tcpdump on ports 2195, 2196 and 5223, as data pass over them: http://support.apple.com/en-us/HT202944
Use Wireshark to read the dump files: http://redmine.streamco.org/projects/smartswitch-public/wiki/Debug_VoIP_call_with_Wireshark