As the title says, I have an app with built in APNS. It does work perfectly in Sandbox-mode. But in production-mode, it fails miserably.
It seems that I have the right certificates on the server, because I don't get an error back from the APNS-Service. Everything seems to work fine. I am using ApnsPHP by Aldo Armiento. It has a built-in function to spit out the results from the APNS-Server. When I try to use the Sandbox with the app from the store, I get - as expected - an invalid-token-error (since tokens from sandbox and production are different). When I use the production-certificate with the app from the store, I don't get an error. Nothing, nada, zilch - it seems like it delivered the notification. Alas, it doesn't arrive on my phone.
So apparently, the certificates must be ok. It connects to the server, it sends the notification, all passes without errors (I did have wrong certificates first, so I know what happens if they're not right :)
Any ideas how to find out where the bug hides?
[Edit] here's what I get back from the APNS-Service:
Tue, 03 Jan 2012 03:13:55 +0100 ApnsPHP[13049]: INFO: Trying ssl://gateway.push.apple.com:2195...
Tue, 03 Jan 2012 03:13:56 +0100 ApnsPHP[13049]: INFO: Connected to ssl://gateway.push.apple.com:2195.
Tue, 03 Jan 2012 03:13:56 +0100 ApnsPHP[13049]: INFO: Sending messages queue, run #1: 1 message(s) left in queue.
Tue, 03 Jan 2012 03:13:56 +0100 ApnsPHP[13049]: STATUS: Sending message ID 1 [custom identifier: Message-Badge-000] (1/3): 107 bytes.
Tue, 03 Jan 2012 03:13:56 +0100 ApnsPHP[13049]: INFO: Disconnected.
Here is three cases you can check at your end:-
Make sure that you have used the right production certificate on your server side. since we need to create two different certificates for production and sandbox. make sure you are using correct certificate on server.
second you can check that you have use the right gateway and port number on server side. Since gateway for production and sandbox are different one. Gateway used for production is:- gateway.push.apple.com. and also you are using correct password on server for your certificate your have used on your server.
third you can check if the notification on your device is enabled or not. You need to enable it on your iPhone as well. Make sure that is on your device.
Let me know if it works for you.