Will Openfire host my Google Cloud Messaging Server?

Although I am developing Android apps, I am a newbie to the world of Java servers. My apps have been using internal SMS messaging to allow the phones to talk to each other. This worked wonderfully until KitKat broke all that. Now I’m looking at GoogleCloudMessaging (GCM) using Cloud Connection Server that uses XMPP.

The Google docs cover about everything I would need to know except that they, mysteriously, stay away from telling how to actually implement my GCM XMPP server. (See https://developer.android.com/google/gcm/ccs.html)

All the other tutorials on the internet also avoid covering this issue.

So, my questions are: Is Openfire a platform that would be good for hosting my GCM CCS XMPP Server? Has anyone used Openfire for this purpose?

While testing I would want to host on my dev box but soon I would need a commercial server hoster.

Thanks,

Gary

Google writes: ‘If you decide to use the XMPP connection server, you can use the provided Python or Java Smack demo apps as a starting point.’

I see little point in using Openfire, Openfire uses XML while Google uses JSON payload within the XML .

You misunderstand the GCM approach. You don’t run your own GCM server. GCM and the “GCM server” is provided by Google.

no, you have to have your own xmpp server to communicate with Google’s GCM Server.

See https://developer.android.com/google/gcm/gcm.html#key

Gary

LG. my background is mainly using Microsoft technologies. I am accustomed to thinking that servers have to have server software to run. For example if you want to run an asp.net website, or a web service, or a WCF Service, or a HTTP REST service you have to run it under Internet Information Server (IIS) or some other “server software”. I think in the java world you have apache?

The Java Smack demo code is just code. It has got to have an environment to run in. They don’t mention how to run it.

However if you want to take the HTTP GCM approach, they go into great detail as to exactly how to do it and how to bring up an HTTP server (https://developer.android.com/google/gcm/http.html). Unfortunately, I need to talk both ways, phone to my server and my server to phone and I need XMPP to do that (according to their docs).

So, I’ve been trying for a couple of weeks now, to figure out what kind of a server environment is needed to run that Smack demo code that talks to Googles xmpp server. It has been very frustrating because it seems no one knows or is willing to share the information.

Gary

‘The 3rd-Party Application Server is a component that you implement to work with your chosen GCM connection server(s). App servers send messages to a GCM connection server; the connection server enqueues and stores the message, and then sends it to the device when the device is online. For more information, see Implementing GCM Server.’

The 3rd-Party server is not an XMPP server. Running Smack in Openfire makes no sense. You could use another J2EE (Jetty, Tomcat, JBoss, Glasfish) server to run the Smack code or write your own server.

PS: There’s no need to use Smack. There are also XMPP libs for .net.

You need our own application server, but this server does’t have to be a XMPP server. The interface to the GCM is merly XMPP (besides HTTP).

1 Like

Solution of your question reside in google documents it self,if you read gcm XMPP(cloud connection server),than you should know that this is a server implemented by gogle it self,all you need a Client not a server, as mention in document java smack library which is used to develop a XMPP client for android client use aSmack (a havily patched version of java smack) hope this answer will help you to solve your doubt you dont need openfire server to implement a Xmpp client

There is a GCM plugin for openfire on github. I’ve never test it but it maybe a good example

Gary,

Did you ever find a solution to this? I’m running across the same issue. It was my understanding that Google did not explain fully how to implement the 3rd party server to do XMPP communication with GCM. But the tutorial on the site that you linked makes it sound like the Smack library will send XMPP messages from user to user ‘out of the box’. I’m trying to add a chat function to my app.

Your GCM server (“3-rd Party App Server”) uses Smack to talk to the GCM Connection Servers via XMPP. Note that using Smack is not a must, you can use any XMPP library (or use HTTP).

I’m still confused about how many pieces there are. Let’s start simple. Is there another piece required besides using the smack library, similar to the tutorial from Google? Do I need to some how code or set up another server besides what is written in the tutorial?