8
votes

I have carefully read all the post that are on topic and Android push notifications. Basically, for a small sum, according to this post Android & (millions of) push notifications, defining three possibilities: Google Cloud Message, MQTT and XMPP.

About Google Cloud Message I see some advantages and some drawbacks (versions of Android, have installed Google Play, count of active google, does not guarantee delivery of notifications in order, etc. ..)

MQTT not know but I discard my readings or their complexity and difficult integration with the other components.

I opted for XMPP, as it is the server that I use to make the plays the game app.

When you are playing a game and player A moves, it sends a message in the chat room he shares with player B, who receives, analyzes and performs the necessary actions in their client app. Thus the development of the game takes place in chat rooms.

But I also like the style of WhastApp or AngryWords, that when a player does not have the application open and the other player sends a challenge to start playing or make a play, a notice appeared in Android.

This is what I call, I hope I'm wrong, push notification. The customer does not ask at certain intervals (polling), but will be the server who initiates the process after the event. I understand that all the methods described, XMPP and therefore, involve having a TCP / IP open permanently.

But is it necessary to perform a publish / subscribe?. If I have 10,000 users, they have to publish / subscribe in pairs? Could do with chat messages to certain types of full JID?

Finally, as to do that only when the app is not open on the device there is a notification in the status bar.

thanks

1

1 Answers

-1
votes

If you want to send a message to the device when the app is not running you will need to use Google Cloud Messaging. You could maintain an xmpp session but that would require the application to run and manage a service in the background.

We chose to extend our xmpp offline messaging module to send GCM and APN push notifications to users who are offline but that does require users to register their devices and we map them to a jid.

You don't need to subscribe to someone to sent them an xmpp message, only if you want to receive presence updates.