1

I'm running the GCM demo server and it works quite well, but there's just one last problem I have: What do I have to do to send a message with content, there's no field for that in the demo server. Or does anyone have another server which I can run on an Apache Tomcat server?

Please help!

Charles
  • 50,943
  • 13
  • 104
  • 142
yanniks
  • 299
  • 1
  • 6
  • 17

2 Answers2

1

In the GCMUtils project I have created a test server where you very easily can send messages. It is a simple maven plugin, here is more information: https://code.google.com/p/gcmutils/wiki/MavenPlugin#Test_server

It does not run on tomcat (it uses jetty), but maybe it can be useful if you want to test your gcm client implementation?

Jarle Hansen
  • 1,993
  • 2
  • 16
  • 29
0

In GCM demo server sample, if you open SendAllMessageServlet.java, you can add your content by modifying line 81.

Message message = new Message.Builder().build();

to

Message message = new Message.Builder().addData("subject", "Hello World").build();

Then, the client can get your content in onMessage() method using intent.getStringExtra("subject");

sam
  • 2,780
  • 1
  • 17
  • 30