1
votes

I'm dealing with Eclipse Luna to build the web app (jsp,java) while dealing with Eclipse Juno to build the android app. Plus, i'm referring to this link as my tutorial http://javapapers.com/android/google-cloud-messaging-gcm-for-android-and-push-notifications/

Registration id generated successfully in android device. But when run Java Application it gives following error.

RegId required: com.google.android.gcm.server.InvalidRequestException: HTTP Status Code: 401

What do I have to do?

1
To help you we need some code. Please post the relevant parts of your code.Halvor Holsten Strand
currently i'm applying this tutorial.... javapapers.com/android/…Nadia
This is probably either because you have missed out some permissions in the manifest or because you are using the wrong GCM register ID. Please post your full stack trace to pin point the problem. And double check the Google API console for wrong keys.shyam
I'm using Google APIs Level 19. I'll edit this post and show the code. thanksNadia
androidhive.info/2012/10/… refer this link alsolearner

1 Answers

0
votes

Check if your IP address is correctly listed in the list of "allowed IPs" for your particular server key in the Google API console.

To obtain your IP follow the link: http://www.ipcow.com/

To check the allowed list of IPs:

  • Go to Google API Console.
  • Select your project using the drop down on the upper left hand corner.
  • Go to the API access tab.
  • Find your "key for server apps" and click on the link "Edit allowed IPs" to the right hand side.
  • Add your IP there. (Or leave it blank)

Note: If you leave the list of allowed IPs blank, any IP is allowed. But try it using your current IP (worked for me).