Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development > iPhone SDK Development - Advanced Discussion

Reply
 
LinkBack Thread Tools Display Modes
Old 07-05-2011, 05:17 AM   #1 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 3
sujay is on a distinguished road
Post 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.

Thanks in advance!
sujay is offline   Reply With Quote
Old 07-06-2011, 04:03 PM   #2 (permalink)
Registered Member
 
Join Date: Mar 2011
Location: The Netherlands
Posts: 44
Hollance is on a distinguished road
Default

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.
Hollance is offline   Reply With Quote
Old 07-06-2011, 08:13 PM   #3 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 139
dudeofswim is on a distinguished road
Default

Port 2196? Are you sure you made the certificates to work in production and development and then reassigned the app to that provisioning profile?
dudeofswim is offline   Reply With Quote
Old 07-07-2011, 07:07 AM   #4 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 3
sujay is on a distinguished road
Default

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 View Post
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.
sujay is offline   Reply With Quote
Old 07-07-2011, 07:09 AM   #5 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 3
sujay is on a distinguished road
Default

Thanks. I figured out the issue. Thanks to Hollance. I was using the same token id for both dev and prod.


Quote:
Originally Posted by dudeofswim View Post
Port 2196? Are you sure you made the certificates to work in production and development and then reassigned the app to that provisioning profile?
sujay is offline   Reply With Quote
Old 07-23-2011, 11:09 PM   #6 (permalink)
Registered Member
 
Join Date: Mar 2011
Posts: 21
famictech2000 is on a distinguished road
Default Issue with Javapns sandbox testing

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?
famictech2000 is offline   Reply With Quote
Reply

Bookmarks

Tags
apns, apple push notification

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 384
18 members and 366 guests
Absentia, AyClass, Diligent, dre, givensur, hussain1982, jbro, jPuzzle, momolgtm, Newbie123, Paul10, revg, sacha1996, skog, skrew88, taylor202, tomtom100
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,643
Threads: 94,110
Posts: 402,858
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Diligent
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 04:44 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0