How to debug if the message went through Apple Push Notification Service?

apple-push-notifications, ios, node.js, push-notification

Solution

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

Problem

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: - There's something happening between my server and apple push server - There's something happening between apple push server and my iOS device But I don't know how to find out what's happening. So what I am trying to find is a solution to: - Find out if my push notification is being registered by APNS - Find out if APNS is sending out all the notifications to my iDevice Anyone know how to do this? Thank you so much!

Original source