Apple recently updated their push reminder service agreement, APNs. This new version of the protocol is based on HTTP/2 and JSON, and the new protocol has improved dramatically compared to the old binary protocol.
The new APNS protocol is based on HTTP/2:
New features and Features:
JSON-based requests and responses
For each notification, if the response succeeds, a 200 identity will be returned-no more guessing whether the notification was received
The response error will be returned as a JSON character
Message length increased from 2048 bytes to 4,096 bytes
The connection status can be checked through the HTTP/2 ping frame
Support Topics
Common push certificate-development and production using the same certificate
The Old APNs binary protocol
The old binary APNs protocol is a bit peculiar, in general, the server that pushes the distribution wants to open a socket connection to the APNs gateway server and keep the connection. Under the old protocol, you will not receive any response if the server responds successfully, but if the server fails to respond (for example, using an illegal push token), the server returns an error code and closes the socket. Most importantly, you must resend all notifications that are sent after using this invalid token. Therefore, you may not be sure whether your push was successfully received by the server. Many systems use this vulnerability to intentionally send a wrong token that will result in poor system performance. Apple has a service called "feedback" that we can call this service periodically to get a list of invalid tokens. This service allows you to get all the invalid tokens lists once you've called. So, if an application has a lot of push notification providers, they will scramble for resources to poll for invalid tokens list. The more invalidtoken you have, the lower your system performance, so APNs closes the connection as soon as the error occurs.
But there are still some restrictions. Obtaining a TLS certificate is more complex, and the storage-forwarding capacity is weak, APNs only keep a notice when the device is offline, and the device will not upload information to the server after the online, Google Cloud messaging have all these features.
Given that GCM now supports iOS devices, APNs and GCM now form a competitive relationship. Let me look forward to the new features of APNs in 2016.