GCM demo server sending message to device raises 401 error

前端 未结 4 1815
既然无缘
既然无缘 2021-01-20 01:50

As many other newbies to java and android i\'m trying to run gcm demo server and gcm demo client on windows, using eclipse to run vertual device and tomcat as a webserer.

相关标签:
4条回答
  • 2021-01-20 02:29

    This issue is not addressed well on any of the forum may be because it has multiple causes. My case was: I was doing a demo of GCM push notifications and it worked the first time. But as I proceeded next day with same code i found the exception mention in the answer. On observation, I noticed that my public IP had changed as it is not static. This IP has to be provided when you create project on google developers console. You can find your public IP by searching "my public IP address" in google. Or for demo purpose i would now strongly recommend you to use IP as 0.0.0.0/0 which is recommended and when you deploy your project, your server IP would be static. You can then replace 0.0.0.0/0 IP with your server IP. Also, check all the keys like 'project number' and 'server API key'. Hope it helps. CHEERS :)

    0 讨论(0)
  • 2021-01-20 02:38

    Commons Daemon procrun stderr initialized

    If any one is getting this above error try check your jvm.dll path default path located is *C:\Program Files\Java\jdk1.6.0_37\jre\bin\client\jvm.dll* change it to the right path.

    0 讨论(0)
  • 2021-01-20 02:40

    I was having this error too,

    enter image description here

    turns out i hadn't enabled Google Cloud Messaging for Android. (On one of my machines, this was automatically enabled while following the same steps, don't know why it didn't do same on the other) Long story short, go to developers console and enable it.

    APIs and Auths | APIs | Google Cloud Messaging for Android

    refresh your browser and try again.

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

    I just answered a similar question - accessing /gcm-demo/sendAll. Reason: HTTP Status Code: 401

    Check the sender API key that you are using.

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