mwkirk / javapns

Test import of svn javapns repo from Google Code
3 stars 0 forks source link

Distribution profile not working with javapns2 , works with earlier version #77

Closed mwkirk closed 11 years ago

mwkirk commented 11 years ago

Original author: dux.dee...@gmail.com (November 01, 2011 12:03:39)

I am able to push using developer profile, but distribution version is not working. I get an error : APNS: [1] Invalid token

Strangely, I am able to push to the same app (on distribution profile) using javapns1.6 ! The problem seems only with javapns2 and distribution environment, as I am able to send the push message using developer profile. Has anyone tested this scenario ?

Thanks !

Original issue: http://code.google.com/p/javapns/issues/detail?id=77

mwkirk commented 11 years ago

From sype...@gmail.com on November 01, 2011 15:18:40 Are you using a different token when pushing to the production server? You cannot use the same token, as documented in the wiki and by Apple.

If you are using a token made especially for the production server and your notification is still generating an Invalid Token error, please provide more details including full log output, the code you are running for the development server and the one for the production server, and any stack traces you get (if any).

mwkirk commented 11 years ago

From dux.dee...@gmail.com on November 02, 2011 06:45:32 I am using the same token - and I have been getting notifications with the same token until now (using 1.6). Can you please provide the link to wiki/docs where using 2 different tokens has been mentioned...

Thanks.

mwkirk commented 11 years ago

From sype...@gmail.com on November 02, 2011 14:12:37 Please refer to the very last paragraph of the "The Binary Interface and Notification Formats" section in Apple's APNS documentation:

http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingWIthAPS/CommunicatingWIthAPS.html%23//apple_ref/doc/uid/TP40008194-CH101-SW4

«Take note that the device token in the production environment and the device token in the development (sandbox) environment are not the same value.»

I have no idea why your token might have worked before (maybe Apple didn't validate token/server relationships at the time you tried), but according to the documentation, you should be generating and using a different token for the production server. Since you are not using the same certificate for both servers anyway, this makes sense to have two tokens also. Is your production app generating the same token as your development app??

Please let us know here if it works with a token generated by your production app.

mwkirk commented 11 years ago

From dux.dee...@gmail.com on November 04, 2011 13:12:11 Thanks for the link - I was wrong in using the same device token. Problem solved !

Thanks :)

mwkirk commented 11 years ago

From sunbi...@gmail.com on November 07, 2011 01:04:01 hi

I have same trouble

but I don't solved device token

Device Token is different (development server , product server)

what's javapns's API by multi device (several device token) ?

please another comment~!!

mwkirk commented 11 years ago

From sype...@gmail.com on November 07, 2011 01:29:57 Please provide more details, including: