abidullah / javapns

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

Success is returning when sent 64-char INVALID registrationToken for APNS. (only length is validated) #208

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Push notification message with 64-char INVALID registrationToken for APNS.
   Ex: http://<hostName>/<project>/rest/platform/apns/registrationToken/this1should2be64character3registration4token5from6push7service89
3. Success is returning though token is not registered in APNS.

What is the expected output? What do you see instead?
1. Invalid tokenId should be returned

What version of the product are you using? On what operating system?
2.2

Please provide any additional information below.
Seems only length validation is done for any request as failure returned for 
any request token has other than characters.

Original issue reported on code.google.com by jayade...@gmail.com on 29 Nov 2013 at 4:51

GoogleCodeExporter commented 8 years ago
The isSuccessful method will return false in the following cases:

* the library rejected the token you provided because of obvious specs 
violations (ex: token not 64-bytes long, etc.)
* the library rejected the payload you provided because of obvious specs 
violations (ex: payload too large, etc.)
* a connection error occurred and the library was not able to communicate with 
Apple servers
* an error occurred with your certificate or keystore (ex: wrong password, 
invalid keystore format, etc.)
* a valid error-response packet was received from Apple servers
* and many other possible errors...

However, the way APNS is designed, it does not validate in real-time during 
transmission if a token is invalid, other than checking if it complies with the 
token specs.  So, the isSuccessful method behaves exactly as it is supposed to. 
 It cannot be enhanced to detect if a token is not registered, simply because 
APNS does not provide that information during transmission.  This is what the 
feedback service is for.

Original comment by sype...@gmail.com on 30 Sep 2014 at 1:19