kaylavanhaverbeck / javapns

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

Exception reporting not working for multiple payloads #228

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create 2 payloads with the first having an invalid device token
2. Send the payloads using thread/queue method so they are sent one after 
another
3. No exception is returned in the first pushed notification object. The second 
payload won't have actually been sent. (no notice for that)

What is the expected output? What do you see instead?
I would expect an exception in the first pushed notification object returned as 
well as the second payload to be sent successfully by reconnecting to the apple 
pns server.

What version of the product are you using? On what operating system?
javapns 2.2 - Windows 7

Please provide any additional information below.
If the payload queue size is only 1 and the payload has an invalid device token 
then the exception reporting works fine.  It seems to break beyond more than 
one payload at a time.  According to the Apple documentation - "If you send a 
notification that is malformed or otherwise unintelligible, APNs returns an 
error-response packet and closes the connection. Any notifications that you 
sent after the malformed notification using the same connection are discarded, 
and must be resent." from 
https://developer.apple.com/library/ios/documentation/NetworkingInternet/Concept
ual/RemoteNotificationsPG/Chapters/CommunicatingWIthAPS.html#//apple_ref/doc/uid
/TP40008194-CH101-SW1 
I think the proper way to solve this problem is to check the socket for 
incoming data after each payload is sent or else the connection is closed and 
when you go to retrieve the error response a socket exception is thrown.

Original issue reported on code.google.com by jgoodfel...@gmail.com on 7 Jan 2015 at 3:34