Nadia
Nadia

Reputation: 61

Google Cloud Messaging GCM for Android and Push Notification

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?

Upvotes: 0

Views: 1068

Answers (1)

shyam
shyam

Reputation: 1388

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).

Upvotes: 0

Related Questions