Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Protocol used for sending push notification in Android

I want to know which protocol is used to send push notification to android devices and which to send push notification requests to GCM.

Whether it is HTTP, HTTPS or some thing else?

like image 202
Mohammad Ashfaq Avatar asked Apr 15 '14 07:04

Mohammad Ashfaq


2 Answers

The protocols of the communication between the 3rd party server and GCM server (HTTP or XMPP) were already mentioned in the other answers.

The protocol of the communication between the device and GCM server is not discussed in the GCM documentation, since you never have to access it directly as an Android application developer, and therefore you don't need to know about it.

However, here's a quote from a Google developer from the team that created GCM, which says a few things about the connection. From what he says, you can only know that it's a long-lived TCP connection.

GCM maintains a long-lived connection - and reconnects if it knows the connection was broken. A router/AP/NAT is supposed to send a FIN or RST to terminate the TCP connection - so GCM and servers will know the connection is dead.

However a number of routers and mobile operators don't do this, and then GCM needs to rely on the heartbeat, ~15 min on Wifi, more on mobile.

(The quote is taken from an answer by that person)

like image 113
Eran Avatar answered Sep 28 '22 04:09

Eran


There are two protocols http and xmpp which you can use to send message to GCM server.

Now its up to you what you want to use. If you want to broadcast message then u should go with http.

you can broadcast 1000 message in a single http request. And only one message through xmpp in a request...

Http can be used only for down streaming(3rd party app server -gcm-mob device)

But gcm won't support up streaming using http. for that you should use xmpp.Xmpp can be used for both up streamlining and down streaming.

Implementaction of push notification can be very easy if you are going with http and that much more hard if you are going with xmpp.but Google has provided detail tutorial how to implement xmpp. So please have a look On Google developer site.

like image 33
Dev Avatar answered Sep 28 '22 04:09

Dev