adrianchia / javapns

Automatically exported from code.google.com/p/javapns
0 stars 1 forks source link

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

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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 reported on code.google.com by dux.dee...@gmail.com on 1 Nov 2011 at 12:03

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
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).

Original comment by sype...@gmail.com on 1 Nov 2011 at 3:18

GoogleCodeExporter commented 9 years ago
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.

Original comment by dux.dee...@gmail.com on 2 Nov 2011 at 6:45

GoogleCodeExporter commented 9 years ago
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/Concept
ual/RemoteNotificationsPG/CommunicatingWIthAPS/CommunicatingWIthAPS.html%23//app
le_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.

Original comment by sype...@gmail.com on 2 Nov 2011 at 2:12

GoogleCodeExporter commented 9 years ago
Thanks for the link - I was wrong in using the same device token.
Problem solved !

Thanks :)

Original comment by dux.dee...@gmail.com on 4 Nov 2011 at 1:12

GoogleCodeExporter commented 9 years ago

Original comment by sype...@gmail.com on 4 Nov 2011 at 2:31

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
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~!!

Original comment by sunbi...@gmail.com on 7 Nov 2011 at 1:04

GoogleCodeExporter commented 9 years ago
Please provide more details, including:

- the code you are trying to run
- the console output when you run your code (with debugging enabled)

Original comment by sype...@gmail.com on 7 Nov 2011 at 1:29