Meaning Of Different Status Codes In APNS Error Response Packets

懵懂的女人 提交于 2019-12-31 10:20:10

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/12446705/meaning-of-different-status-codes-in-apns-error-response-packets

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!