21

APNS returns the following status codes in error response packets when using the enhanced notification format.

0   - No errors encountered
1   - Processing error
2   - Missing device token
3   - Missing topic
4   - Missing payload
5   - Invalid token size
6   - Invalid topic size
7   - Invalid payload size
8   - Invalid token
255 - None (unknown)

I want to know which of these status codes actually indicate that the issue is actually with the device token (ie: I can mark that particular device token in my database as invalid or inactive). I am sure that I can safely do that when I receive a value of 8 as status code. Also, I am pretty sure about what status codes 2, 4, 5 and 7 indicate and when exactly are they returned.

But for the rest of the status codes, I am pretty much in the dark. Apple's website does not contain much information about them either.

Can anybody please enlighten me about each of these status codes in detail. Many thanks in advance.

Till
  • 27,559
  • 13
  • 88
  • 122
Raj Chaudhari
  • 880
  • 2
  • 7
  • 10
  • 1
    Did you ever find an answer for this? I'm wondering what exactly a 'topic' is and why I seem to be getting error code 6, but my notifications still get sent. – Baza207 Jan 31 '13 at 00:06

1 Answers1

8

You're right about the 2, 4, 5, 7, and 8. 0 is good news obviously. We're left with:

1   - Processing error
3   - Missing topic
6   - Invalid topic size
10  - Shutdown
255 - None (unknown)

1 is a problem on Apple's side, not related to the token.

3 is, according to Apple :

The topic is currently the bundle identifier of the target application on an iOS device.

6 is related to 3.

10 is out of your control but good to handle as well.

And obviously, 255 will not be able to help you define if the token is the problem.

If your goal is to determine a token that was valid at some point and no longer is, you should really refer to the Feedback Service API.

Nick
  • 2,573
  • 19
  • 21
  • am getting error 137, could you please tell me what it mean? or could you redirect me to any documentation i couldnt find any.. – Abhiram Sep 22 '14 at 14:08
  • @Abhiram I'm not sure what that means or how you're getting it exactly. Is it possible that you're actually combining several errors into one string? – Nick Sep 26 '14 at 12:57
  • If i use push notification in rails console, am getting a response as 137, as you said i think it is combining all error codes into one string i.e 1 3 and 7. Could you tell me what that mean? – Abhiram Sep 27 '14 at 08:43
  • The definitions are clearly described in the Apple docs. Can you post an example of a payload that's returning this error? – Nick Sep 29 '14 at 09:59
  • The link of Feedback Service API lead to 404 error page. – Levent Yumerov Jun 13 '16 at 13:37
  • 2
    @zennin Here the link [Feedback Service](https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Appendixes/BinaryProviderAPI.html#//apple_ref/doc/uid/TP40008194-CH106-SW4) – Taras Budzyn Jul 25 '16 at 18:07
  • guys, link is broken, does anybody have the valid one? – andrepaulo Jan 05 '18 at 20:53