Skip to content Skip to sidebar Skip to footer

Can't Receive Messages On Device Using Gcm

i've followed google instruction on initiating a gcm server and client. my problem is though i get a successful gcm from server : MulticastResult(multicast_id=8287827393174436535

Solution 1:

To maximise your chances of receiving the message, I would not set the time_to_live at a mere 3 seconds. I'd omit this parameter altogether so that it takes the default value of 4 weeks. I would also set delay_while to false, so that the phone gets the message even whilst idle.

Solution 2:

Well your message is surely getting sent to your device since gcm sends a success status of 1. Try to check the GCMReceiver code of your app.

Solution 3:

Change the following code in your onMessage method:

Log.i("Registration", "Got a message!");
             Log.i("Registration", context.toString() + " " + intent.toString());

to this:

String message=intent.getStringExtra("message"); 
Log.w("The message received is", message);

hope this help

Post a Comment for "Can't Receive Messages On Device Using Gcm"