XMPP (Openfire) Push Notifications Android
Solution 1
Well, you could use GCM with XMPP. The new GCM Cloud Connection Server allows you to use the XMPP protocol for a bidirectional (Cloud to Device and Device to Cloud) communication between your server and your Android application.
The GCM Cloud Connection Server (CCS) allows third party servers to communicate with Android devices by establishing a persistent TCP connection with Google servers using the XMPP protocol. This communication is asynchronous and bidirectional.
Solution 2
I am studying the openfire and found some good options that I would like to share with you. I found a plugin in github and i will test it this week. It seems that will be a good solution to your goal and to my: https://github.com/meisterfuu/Openfire-GCM/
Another option is to use CallbackOnOffline Plugin that calls a specified URL with To and From parameters. This url could be a endpoint in your web service, and with that data (To and From) you could get the associated Id for push in your base, and did a push.
https://www.igniterealtime.org/projects/openfire/plugins.jsp
Related videos on Youtube
Max
Updated on June 04, 2022Comments
-
Max about 2 years
I really tried to find a solution to this problem but didn't. There are some threads related to this concept, but I didn't find a comprehensive solution.
I have a server with Openfire which sends messages. When both users are online, there is no problem. However, when a user is offline I would like to send a push notification, as in Whatsapp. I heard that Whatsapp and other IM apps use a modified version of ejabber to send push notifications, but couldn't find out how.
One possibility is to use GCM, but I am not sure if this is the right way to go. Also I would like to avoid polling, for the sake of not draining battery life.
Does anyone know some solution to this or has an example?
-
Max about 11 yearsI will give it a try. I see how this might me be a good solution. Once your solution has worked for me I will accept your answer :)
-
Eran about 11 yearsWell, it's worth a try, but don't forget it's a trial feature, so it may not be ready yet for production.
-
Max about 11 yearsWell thats true, however I would like to make a Instant Messenger, which requires a push notification in the case the user is offline. I want the user to be informed once he was sent a message (a push notification).
-
Max about 11 yearsI was hoping to avoid using GCM, since a google account was needed on the device to receive a push notification, however I see this as the only option at the moment. Thanks again for your answer.
-
Lin Yu Cheng over 10 yearsWhy you don't run a background service and keep connection to OpenFire?
-
Pierre over 6 yearsOpenfire-GCM does not work. Do you perhaps have an updated version?