PHP-APNS fails to send push notifications

by Jason on June 23, 2010

Lately I’ve been involved heavily in iPhone development. Not so much on the Objective-C side, but more on the developing of supporting APIs and setting up a push notification system.

We decided to use PHP-APNS for the server-side Push Notification system. Their set of scripts (along with a few keepalive shell scripts) power our Push Notification server in a scalable fashion.

The problem

Once our app was approved and sold, we switched our certificates from development to production. Suddenly, we weren’t able to send push notifications to more than one phone! This was worrying.

We did the normal thing of isolating who owned what device token (so we weren’t sending push’s to strangers!), and tested, tested, tested.

The solution

It turns out that the problem was with our development device tokens. As soon as I stopped attempting to send Push Notifications to the device tokens used during the development period, everyone else was able to receive Push Notifications just fine!

I wanted to post this online because I searched all over the place and found no solution. Several people asked the question, but none received an answer. Here is the answer!