Push notification head-scratcher, solved

December 21st, 2010 Comments Off on Push notification head-scratcher, solved

So here I was, testing push notifications on various devices. I plugged in the old iPod touch (which had been out of juice for a few weeks) and ran the app on it in the Xcode debugger.

But something odd was happening. After my appDelegate called registerForRemoteNotificationTypes:, I was not getting any response callback at all; neither application: didRegisterForRemoteNotificationsWithDeviceToken: nor application: didFailToRegisterForRemoteNotificationsWithError: was being called. That’s right, not even an error callback.

Meanwhile, the code was working fine on my iPhone. A few quick Google searches didn’t turn up anything very useful, except for one suggestion to try installing another app from the app store that used push notifications. I figured that would at least be good for a test.

I launched the App Store app, and tried to download Boxcar. I immediately got this alert:

Alert: Cannot connect to the App Store. A secure connection could not be established. Please check your Date & Time settings.

The clue!

Aha! Of course. Because the iPod touch’s battery had died, its clock had been reset to 1969, and thus could not make an SSL connection to Apple’s servers. Setting the iPod’s clock to the correct data and time fixed the issue: push notifications were now working correctly.

I just thought I’d document this in the off chance that it might help someone else :)

Comments are closed.

What's this?

You are currently reading Push notification head-scratcher, solved at bunnyhero dev.