Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meaning Of Different Status Codes In APNS Error Response Packets

Tags:

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.

like image 405
Raj Chaudhari Avatar asked Sep 16 '12 12:09

Raj Chaudhari


People also ask

What is APNs authentication key?

You need an APNs authentication token signing key to generate the tokens used by your server. You request this key from your developer account on developer.apple.com, as shown in Figure 1. When you request a key, Apple gives you: A 10-character string with the Key ID.

What is APNs and how it works?

An Access Point Name (APN) a allows device's network to connect to the internet. With the APN settings in place, your device builds a connection to a carrier's gateway. Part of this process involves the carrier using a defined APN network to choose the assigned IP address(s) and security settings where applicable.

What protocol does APNs use?

0, HTTP/2 is the default protocol for connections to APNs. This means that all mobile device management (MDM) communication, such as remote commands, configuration profiles, applications, and push notifications, is handled by the HTTP/2 protocol.


Video Answer


1 Answers

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.

like image 76
Nick Avatar answered Sep 19 '22 18:09

Nick