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

前端 未结 2 628
-上瘾入骨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.

提交回复
热议问题