Is it good to use only GCM to develop chat applications for the XMPP android?

Many applications, such as WhatsApp rely on GCM to send notifications to the device when the device is in standby mode or the application is running in the background. The GCM message simply tells the application to sync from the server, and then XMPP used for the actual chat (payload delivery). But is there a good solution to rely on GCM to send messages. Therefore, in my case, when one user wants to talk with another, he sends a message to my server, and then I deliver the message to another user through GCM . I understand that GCM not 100% reliable, but I can provide reliability with timeouts and confirmation messages. Is there anything else that could harm me if I fully agree with GCM . The reason is not that you do not go with XMPP , because it will take a lot of effort to scale the XMPP server (which I am not very good at), but in the case of GCM many of my scaling problems will be accepted from Google.

+8
android google-cloud-messaging xmpp
source share
1 answer

I use GCM to warn the client about the connection. If you simply rely on GCM to deliver payloads, you cannot easily track message delivery.

For example, I use a very basic form of flow control in my application, so I prefer to use it only for the synchronization service and allow my client / server to communicate directly.

It is also not extensible, although you could put the xml in the body of the message and parse it.

I'm not sure what a delivery guarantee is, but I will also check it on the Google side, and if you use it to deliver multiple messages, you need to make sure that you include the collapse_key function in your client, because GCM will combine your messages into one if there is a delay in sending, if you use a large amount.

Another thing I'm not sure about in real time is GCM, so I'm not sure how cool this is for a real chat application.

I would consider these things before using GCM to deliver the payload.

+2
source share

All Articles