Facing issue with GCM - Message not received on device - android

I am following the google guidelines for setting up GCM on my device and the server side. I successfully got the device registration ID and when I use it to send a message using the sever side code given by google, I am getting success as well. But no message is received on my phone. Please help.

Refer the link, understand the concept and refer class GCMIntentService.

According to GCM Architectural Overview, GCM uses ports 5228, 5229, and 5230 to send messages. If you do everything right but still not receiving the message, ask your web administrator and confirm that these ports are open.

Related

Hows App server and GCM server are different in functioning?

I follow this link PLease see here . Can anyone tell me exact process to communication between two mobile devices in terms of push notification. Please help me.
GCM is a google cloud messaging http server.It is used for providing notification service on android phones any notification you receive on your phone is sent through GCM.Every device using a specific application is registered with GCM. Even if you want your application to send notification to the user on occurrence of something it's not possible without GCM.

Android GCM says Error=NotRegistered, but I registered my app

I am new to Android GCM environment.
I am writing java codes to receive GCM message with Google's 'getting started' page. http://developer.android.com/google/gcm/gs.html
I wrote android client code with them and wrote C# code to send message to GCM server.
My app successfully registered its device and got registration id like 'APA91bGOqUv--of9MyUevAvFq-RNh375O7S5m5y_WvuSwn1zJqbIsGJpzkJda99RIL1jgZ0zC89RC5q8scj3eZMqMeLdTlUsqfSBD_A4jr_000000000000000000000000n_QWhC0Q8KEzQl_icWaBRS4DeMIK_puCzFBO6rArcq8Lax4_YilU'.
But when my C# code call the GCM server - https://android.googleapis.com/gcm/send - to send message, it returns 'Error=NotRegistered'.
I didn't upload my app to official app store, but I don't think it does matter.
Would anyone give me advice to solve this issue?
Thanks in advance.
I found the reason.
Every time when I try to debug, app need to get registered again.
The registration id above is expired.
I received it again, and it worked well.

UnExpected reply from GCM Server when i am sending the Expected URL

**Question (i)**
I have registered my android app in my mobile (Samsung Galaxy Pop) i am recieved a
registrataion_id
APA91bG9NI4U2jr4sUn1HLy5nHMFe1e0JOTgOoZv1Px**********************************
when i sent this registration_id to server side code which is refrenced from here
here i used function SendNotification having 2 parameters
My Registration_ID
My Message Which i want to show on notufication
http://www.codeproject.com/Tips/434338/Android-GCM-Push-Notification
I hit the GCM- Server and the result I got is
id=0:1368258967353783%978fee9266d6cf16
I did not understand what does this response means ? is it good ? bad ?
Question (ii)
if mobile device gets registration id from gcm server is it registered or still waiting for server side to send the Registration ID to GCM Server
Please help !! , Thanks in advance
Answer to(i)
The data you are getting is on plain text format and the data is refering to the message id. In this case the message was correctly sended.
To understand how it works visit this page GCM Architectural Overview
Answer to (ii)
The way GCM works it's
Your device request a registretion to GCM services.
Device is registered correctly by receiving the regId.
You send that regId to your server to receive push notifications.
Server saves the data
Servers wants to send a message to that device, sends a mesage using GCM services.
The device, if it is online, receives it and knows wich app haves to start.
The app receives the message.
On the same website you have further explanation, by the way start reading from getting started section.

How to confirm successfull communication between my server and GCM server

I am following Google official tutorial for demo Google Cloud Messaging from http://developer.android.com/google/gcm/demo.html . I set up the gcm-demo-client and gcm-demo-server.
Now, when I run applicaiton, its works well. The device is registered to my server. Then when I click sent message in my server to invoke, its says the message is sent. I assume the process sent message correctly to GCM since its their official sample server for tutorial.
However, my message is not delivered to client applications.
When I see report status about my project in GOOGLE API CONSOLE, the request per day info are 0. Should not it be changed if my server sent message to GCM to deliver to registered device?
Is there anyway to confirm that my server message has been successfully delivered to GCM first? If i confirm this, then can confirm that message is being late.
I tried with both server and browser API key. DO it take time to deliver?
Thanks in advance for your support and any help.
The demo in the tutorial works well. Finally, I was able to get the push message. However, the message was delivered late then expected in about 15 min. Why is it happening so? I don't think its reliable to use.

How to send one common C2DM message to more than one device

I want to send one common message say "Happy new year" through C2DM to more than one registered device. I have got few ideas about C2DM from the link http://code.google.com/android/c2dm/index.html and understood that each devices registered for C2DM they have different auth token and registration id. So is it possible for the third application server to send the same message to all the devices registered with. I am using the sample code for Chrome to phone downloaded from http://code.google.com/p/chrometophone/source/checkout.
So any help from any one would be appreciated.
To be clear, the devices don't have authentication tokens. Your application server uses the ClientLogin auth token to authenticate with C2DM for sending pushes. During registration, each device receives a registration ID which it communicates to the application server.
At the moment, C2DM does not support batch sending. You will have to iterate through your devices and send each one of them the same message.
See
this thread for details.

Categories

Resources