APNS错误响应报文中不同状态码的含义 [英] Meaning Of Different Status Codes In APNS Error Response Packets

查看:30
本文介绍了APNS错误响应报文中不同状态码的含义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

APNS 在使用增强通知格式时在错误响应数据包中返回以下状态代码.

<前>0 - 没有遇到错误1 - 处理错误2 - 缺少设备令牌3 - 缺少主题4 - 缺少有效载荷5 - 无效的令牌大小6 - 主题大小无效7 - 无效的有效载荷大小8 - 无效的令牌255 - 无(未知)

我想知道这些状态代码中的哪一个实际上表明问题出在设备令牌上(即:我可以将数据库中的特定设备令牌标记为无效或不活动).我确信当我收到值 8 作为状态代码时,我可以安全地做到这一点.此外,我非常确定状态代码 2、4、5 和 7 表示什么以及它们何时返回.

但是对于其余的状态代码,我几乎一无所知.Apple 的网站也没有包含太多关于它们的信息.

任何人都可以详细说明这些状态代码中的每一个.非常感谢.

解决方案

关于 2、4、5、7 和 8,你说得对.0显然是个好消息.我们只剩下:

1 - 处理错误3 - 缺少主题6 - 主题大小无效10 - 关机255 - 无(未知)

1 是 Apple 方面的问题,与令牌无关.

3 是,根据 苹果 :

主题当前是iOS设备上目标应用程序的包标识符.

6 与 3 相关.

10 是您无法控制的,但也很好处理.

显然,255 将无法帮助您确定令牌是否有问题.

如果您的目标是确定某个令牌在某个时间有效且不再有效,则您应该真正参考 反馈服务 API.

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.

解决方案

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.

这篇关于APNS错误响应报文中不同状态码的含义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆