Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are pushed notifications to mobile phones really pushed?

I know that notifications can be pushed to servers using http/s but can mobile phones really be pushed to from those servers? Technically it is my guess that mobile devices actually poll the notifications servers to see if there are any new notifications and that this is a sort of 'pseudo push'.

So that's my question - do mobile phones truly receive live, pushed notifications or are they actually polling? The reason I ask is that it would seem to be incredibly expensive on the network for mobile phones to have a constantly open channel to masts as a user moves around. Anyone know what the technical detail is?

like image 415
Wittner Avatar asked Oct 27 '15 09:10

Wittner


1 Answers

Apple Push Notifications are delivered to the device over a TCP connection. The iOS device initiates a TCP connection on port 5223 (with a fallback to 443 on WiFi if 5223 cannot be reached).

Once the TCP session is established very little traffic is required to keep the TCP connection alive - just an occasional keep-alive packet.

When a push notification is to be delivered, the Apple servers look for an existing connection to the device. If a connection is found then the data stream is sent over the already established connection, so in that sense it is a "push".

If there is no existing connection to the target device then the message is held on the Apple server until the device connects (or the message expires), so at this level it is more like a "pull" - with the device initiating the connection when it can.

I imagine GCM works in a similar way.

like image 77
Paulw11 Avatar answered Oct 22 '22 21:10

Paulw11