I got success message as response to web server (localhost) from gcm. But the message is not received by the devices. Please help. Below is the code which I used.
I found the solution myself. I was using the "android api key" to send the message from my web server (php) to gcm server and that was the problem. Using "browser api" key solved the issue.. Create a new "browser api key" from google console and use it in the php code to send a message from web server to gcm.
If you want to send a message from android device to gcm, try using android key. Make sure, you create all these keys from the same project under google console.