Not able to receive GCM message in my device, even though the server got success message

前端 未结 2 627
-上瘾入骨i
-上瘾入骨i 2021-01-15 02:29

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.

相关标签:
2条回答
  • 2021-01-15 02:54

    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.

    0 讨论(0)
  • 2021-01-15 02:55

    I had same problem of receiving push messages, even though GCM server replies "Success", because of wifi privacy. When I used my company wifi, I coudn't receive message in mobile, since they were blocked GCM server port . So, even your wifi also could be a one of the reason. check it once { this answer is for others , who may face this}

    0 讨论(0)
提交回复
热议问题