Android push notifications with XMPP

I carefully read all the posts that are dedicated to the topic and alerts of Android. Basically, for a small amount, according to this Android message and (millions) of push notifications , three possibilities are defined: Google Cloud Message, MQTT and XMPP.

About Google Cloud Message I see some advantages and some disadvantages (Android versions installed by Google Play, the number of active google, do not guarantee delivery of notifications in order, etc.)

I do not know MQTT, but I discard my readings or their complexity and complex integration with other components.

I chose XMPP, as this is the server that I use to create the game application.

When you play a game and player A moves, he sends a chat message in which he shares with player B, who receives, analyzes and performs the necessary actions in his client application. Thus, the development of the game takes place in chat rooms.

But I also like the WhastApp or AngryWords style, that when a player does not have an open application and another player sends a call to start playing or playing, a notification has appeared on Android.

This is what I call, I hope that I am mistaken, we push the notification. The client does not request specific intervals (polling), but will be the server that initiates the process after the event. I understand that all the methods described are XMPP and, therefore, are associated with the constant opening of TCP / IP.

But do I need to publish / subscribe ?. If I have 10,000 users, should they publish / subscribe in pairs? Could make chat messages for certain types of full JID?

Finally, to do this, only when the application is not open on the device, there is a notification in the status bar.

thanks

+8
android push-notification xmpp
source share
1 answer

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

We decided to expand our xmpp messaging module to send GCM and APN notifications to users who are offline, but this requires users to register their devices, and we map them to jid.

You do not need to subscribe to someone to send an xmpp message only if you want to receive presence updates.

-one
source share

All Articles