When implementing a push notification feature into your application, you usually create two different types of certificates: One for development (sandbox) and one for your customers/testers (production).
As you might already know, your device will automatically run in sandbox mode when launching the app directly from XCode.
So, the following method inside your app delegate will receive a device token, which is different than the one it receives, when you install it via iTunes:
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)devToken;
You have to keep in mind, that your push messages will not get delivered on this device, if you’re not running the development (sandbox) certificate on your server. Another important thing is the fact, that in case your server is running the production certificate and you try to send a push message to a device in sandbox mode, it will break connection to APNS. This means, that even push messages using the correct certificate will not get delivered any longer, until you reset connection to APNS.
So, if you sometimes wonder why push notifications fail during development of your app, consider the above.
