1
votes

Okay, we all know what GCM is capable of, but my question is: will GCM be reliable to handle a chat app? I mean can it handle sending messages (quickly) to hundreds of people? if no then what is the best way?

I've been reading a lot about chat apps, I found out that we have to use XMPP, but all I could find are APIs that doesn't integrate with MY server, like Parse (we have to signup and signin with their backend which is not very handy)

Thank you all

EDIT: How about Google Cloud Messaging GCM CCS with XMPP

2
I'd use Firebase.mbmc

2 Answers

5
votes

For chat application only GCM is not enough as it might delay or miss sometime. You can go with MQTT( have multiple advantage over XMPP for mobiles platform) plus GCM. Approach should be:

1) Use MQTT persistence connection if user is in foreground. That would be much faster and will be realtime with delivery report and read receipt of chats. You can use GCM to wakeup MQTT connection when it is not connected.

2) Relay on GCM when user is not using chat actively and in background(Close MQTT connection).This will save your battery life as well as network usage.

For sample code you can go through our Applozic opensource chat sdk.

1
votes

GCM, in my opinion and experience with it, is not fast enough. And Google never claims it would be. A chat server/service needs to guarantee a certain time in which messages would be delivered, at least 99.9% of the times. Even if you don't want the delivery reports for chats, which many chatting applications still don't provide, GCM itself would be slow for a chat app. You are better off with XMPP servers only