1

Is signup for "Upstream Google Cloud Messaging and User Notifications Sign-up" at link "https://services.google.com/fb/forms/gcm/" compulsory to get notification from server app to device?

I have created sample app and sending the sample notification from server. i m getting "OK" response along with message_id, i assume that means my message has been accepted by GCm bit the message is not getting delivered to registered Device? I read somewhere with GCM, registration to the link above is required. I tried that too but i didnt get any response back from google. am i missing anything?

Harshil.

Harshil
  • 13
  • 2

2 Answers2

1

Yes, it is compulsory. When sending a message through GCM, you need to specify a SENDER_ID which is given to you when you create a Project inside, and for this, you have to sign up. So even if you got an OK response, I doubt you specified a correct SENDER_ID so this message probably got discarded.

Maybe this might help:

Community
  • 1
  • 1
nKn
  • 13,691
  • 9
  • 45
  • 62
  • I verified the SENDER_ID and it is correct. I also sign up to the link mentioned in the question i.e. at "https://services.google.com/fb/forms/gcm/" but didnt got confirmation ever. Any idea how much time does it take to get confirmation? Thanks for quick reply. :) – Harshil Apr 23 '14 at 08:44
  • I don't know whether you're at the correct place, for registering a project in `GCM` the URL is https://console.developers.google.com/project Try it that way – nKn Apr 23 '14 at 08:47
  • Yep i have registered here and have a valid project with sender id and api key. I am using the same to register device using GoogleCloudMessaging.Register(SENDER_ID); method and getting reg id in response. One more thing i doubt is signing the sample app. Is it required to sign it to make it notification enable for real android device? – Harshil Apr 23 '14 at 09:04
  • No, as far as I know it's independent. I have many apps testing on real devices and none of them have been signed, so I guess it has nothing to do with it. – nKn Apr 23 '14 at 09:46
  • 1
    Ohk, seems like i m blocked now :( i dont know how to troubleshoot this now. My device is getting registered successfully, GCM is accepting the message from server but not sending it to device for some unknown reason. Does they provide any URL where i can check whether my message is received by GCm or delivered to Device by GCM server? – Harshil Apr 23 '14 at 09:53
  • I'm not sure whether GCM blocks messages, I can't find anything in the documentation about it. I guess the best way of handling this is viewing the return code, have a look here: http://developer.android.com/google/gcm/http.html – nKn Apr 23 '14 at 10:08
  • Just verified the same as well. here is the response (8f {"multicast_id":8110567185684342878,"success":1,"failure":0,"canonical_ids":0,"results":[{"message_id":"0:1398249107360530%2febaa85f9fd7ecd"}]} 0 ) where success:1 represents that message count 1 successfully accepted by GCm server and response header contains "HTTP/1.1 200 OK" too. Is there anything mandatory at client side to get message from GCM? – Harshil Apr 23 '14 at 10:34
  • As far as you set the `header` as it should be, everything should be ok. The response you've pasted seems to be ok, though. Test whether your `IntentService` (which receives the GCM message) is working well. – nKn Apr 23 '14 at 10:40
  • Ok Does that mean the IntentService should be in running stat all the time in background to receive the GCM notification? As per the example it starts the intent service when BroadcastReceiver receives the message and pass on to service for further process. Is this the flow? Means OnReceive method of BroadcastReceiver is the entry point right? – Harshil Apr 23 '14 at 11:33
  • Yes, that's it. This service will have to be running in order to permit messages arrive, if it's not running, the `GCM` server will try to deliver it for 4 weeks each certain time, but this is the entry point. – nKn Apr 23 '14 at 11:46
0

As of June 2014, sign-up is no longer required for GCM upstream user notifications (among other features).

There's a post on the Android Developer Blog with more info. Specifically:

At Google I/O we announced the general availability of several GCM capabilities, including the GCM Cloud Connection Server, User Notifications, and a new API called Delivery Receipt. This post highlights the new features and how you can use them in your apps. You can watch these and other GCM announcements at our I/O presentation.

Trevor Johns
  • 15,682
  • 3
  • 55
  • 54