Push Notification not working using production certificate
When i test Push Notification with apn_development_cer, it works with the loaded app on the iPhone device from Xcode.
But, when i am downloading the same application from App Store or with the Ad Hoc Distribution on the same iPhone device from Xcode, it just stops sending Push Notification with apn_production_cer.
For the sandbox instance we are using gateway.sandbox.push.apple.com, port 2195 while for the production build we are using gateway.push.apple.com, port 2195. We have verified that the port 2195 is not blocked by the firewall.
Print out the device token with NSLog() to the console window. When you run the app in Debug mode, does it have a different device token than when you run it in Ad Hoc/App Store mode? If not, then that's your problem.
The device token is different between the development/production environments, but the app/device may be caching the old token and you won't be able to receive the notifications from the other environment.
I'm not sure what the best way is to make the app get the new token. You could probably use a different bundle ID for development, then there shouldn't be a mix-up. When push notifications first came out, the standard fix for this was to run Tap Tap Revolution or any other app that used push, and then your own app again. Maybe you can give that a try.
Thanks a Ton Hollance. i was using the same the token id. i used the production token ID and it worked.. Thanks for your response
Sujay
Quote:
Originally Posted by Hollance
Print out the device token with NSLog() to the console window. When you run the app in Debug mode, does it have a different device token than when you run it in Ad Hoc/App Store mode? If not, then that's your problem.
The device token is different between the development/production environments, but the app/device may be caching the old token and you won't be able to receive the notifications from the other environment.
I'm not sure what the best way is to make the app get the new token. You could probably use a different bundle ID for development, then there shouldn't be a mix-up. When push notifications first came out, the standard fix for this was to run Tap Tap Revolution or any other app that used push, and then your own app again. Maybe you can give that a try.
Using the Javapns library. Everytime I try to send out a notification I keep getting the following
Connection initialized...
Attempt failed... trying again
java.net.SocketException: Socket is closed
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkEO F(Unknown Source)
at com.sun.net.ssl.internal.ssl.AppInputStream.read(U nknown Source)
at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
at sun.nio.cs.StreamDecoder.read(Unknown Source)
at java.io.InputStreamReader.read(Unknown Source)
at java.io.BufferedReader.fill(Unknown Source)
at java.io.BufferedReader.readLine(Unknown Source)
at java.io.BufferedReader.readLine(Unknown Source)
Can anyone tell me why the socket is closed? and how do I open it if that is the case?