Push Notification Troubleshooting on Mountain Lion
I'm developing a Mac app that intends to receive push notifications using APNS. It seems I'm a bit off the beaten path here, so I'm sharing some information here to help the next developer to come along.
Technical Note TN2265 tech note is very helpful. It mentions using push notifications on the Mac, and tells you how to turn on logging so you can see diagnostic messages from the push notification service.
Unfortunately it's dated 2011, before there were any push notifications on the Mac, so I'm not sure what the information was talking about. Here's the relevant bit:
$ sudo defaults write /Library/Preferences/com.apple.applepushserviced APSWriteLogs -bool TRUE $ sudo defaults write /Library/Preferences/com.apple.applepushserviced APSLogLevel -int 7 $ sudo killall applepushserviced
In Mountain Lion, there is no applepushserviced. Seems it's been renamed to apsd.
$ ps -ef | grep apsd 0 62 1 0 10:55am ?? 0:02.06 /System/Library/PrivateFrameworks/ApplePushService.framework/apsd
So the commands to use are:
$ sudo defaults write /Library/Preferences/com.apple.apsd APSWriteLogs -bool TRUE $ sudo defaults write /Library/Preferences/com.apple.apsd APSLogLevel -int 7 $ sudo killall apsd
And the log file it generates is /Library/Logs/apsd.log. It's only readable by root so you'll need to sudo to read it.
Unfortunately, this doesn't actually help me, as my problem is that notifications are being sent to APNS but not actually making it to my Mac. The log shows no activity when I push a message, so I'll keep looking.