Apple has recently updated the protocol push notifications delivery service, called APNS. The newer version of this protocol is based upon HTTP/2 and JSON, which signals a huge improvement compared to the older binary protocol.
News HTTP/2 based APNS Protocol
New features and capabilities:
- A JSON based request response protocol
- APNS will send 200 Success Response on each notification - No more guessing whether a notification has been accepted or not.
- Error response is a JSON string
- Message length increased from 2048 bytes to 4096 bytes
- The connection status can be checked with help of HTTP/2 PING Frame
- Support for topics
- Universal Push Notification Certificate - Use the same credentials for Development and Production
Old APNS Binary Protocol
The old binary APNS protocol was very idiosyncratic. Basically, the push delivery server had to open a socket to the APNS gateway server, and keep on writing to the socket. With this old model, you wouldn’t receive a response if you were successful, but if there were any errors (for example in case of an Invalid Push token) then the server sent back an error code and closed down the socket. On top of that, you had to resend all notifications that you had sent after this invalid token. As a result, you could never be sure if your push was accepted successfully by the server. Many systems used tricks like sending an invalid token on purpose. All of these hacks resulted in lower performance for the system. Apple has a "feedback" service, which you can call periodically to get a list of invalid tokens. The main problem with this service is that you could only call it once to get a list of invalid tokens. So, if an app is using multiple push notification providers, they are going to compete in order to get the list of invalid tokens. The more invalid tokens you have, the lower your performance is, as APNS drops connection for any error.
Some other limitations are still present. It is a complex process to obtain the TLS certificates. There are poor store-and-forward capabilities - APNS stores only a single notification on its server if the device is offline. In addition, there is no upstream messaging from the device back to the server. Google Cloud Messaging has all of these capabilities.
There is a bit of competition with GCM and APNS, especially considering the fact that GCM now has added support for iOS. Let's hope for additional APNS features in 2016.