0

I'm new with Android GCM and I downloaded the appengine demo application provided by Google. I was looking at the server side and first I thought that the servlets (HomeServlet, RegisterServlet, etc.) were part of GCM, but when I looked into client side I saw that first it's called GCMRegistrar.register and, if it's successfull, then a post request is sent to the register servlet on the server side.

So I guess that these servlets should be replaced with my server application (it's currently running without GCM) and I only need to call GCMRegistrar.register in my client side for the device to be registered. Am I right?

PX Developer
  • 8,065
  • 7
  • 42
  • 66
  • You should edit your server side too.With api key initializer ,enabling android google cloud message service ,and Sender Message – Yahor10 Sep 18 '12 at 08:59
  • My server application (actually I'm implementing an API) is implemented in PHP. Do I have to run ApiKeyInitializer aside from my application? I found this post and doesn't mention Api key initializer: http://stackoverflow.com/questions/11242743/gcm-with-php-google-cloud-messaging EDIT: I'm only using appengine to run the GCM demo. – PX Developer Sep 18 '12 at 09:33
  • Ok, I'm gonna test it right now. Thanks! :) – PX Developer Sep 18 '12 at 10:35

3 Answers3

1

So I guess that these servlets should be replaced with my server application (it's currently running without GCM)

Correct.

and I only need to call GCMRegistrar.register in my client side for the device to be registered.

Also correct.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
1

Here is a step by step overview of implementing GCM. It includes registration on the device, then sending to your server for storage (the registration id), and finally sending notifications to GCM from your server.

http://fryerblog.com/post/30057483199/implementing-push-notifications-with-gcm

Paul Fryer
  • 9,268
  • 14
  • 61
  • 93
0

Here is also a simple tutorial with step by step implementation

http://androidv5.wordpress.com/2012/08/15/how-to-implement-google-cloud-messaging/

Satheesh
  • 646
  • 1
  • 10
  • 33