2 ms·
The push servers (Google, Apple, etc.) effectively work as a message queue server - they aggregate and batch payloads and send them to the devices. The devices
by izacus 6y ago
The push servers (Google, Apple, etc.) effectively work as a message queue server - they aggregate and batch payloads and send them to the devices. The devices keep a single persistent HTTP connection for reception of all possible messages.
It's built like that due to efficiency - the devices need to minimize number of radio and CPU wakeups to keep running on battery. In early days of Android each app handled this by itself. This resulted in apps polling their servers on fixed interval (e.g. every 5 minutes, etc.) which caused a disastrous tragedy of the commons and horrible standby battery life.
This is why the approach was changed to mandatory push services - the long-lived TCP connection, push aggregation and radio management have significantly prolonged battery life.