4

We are trying to add our GCM API key to the azure notification hub and we are receiving the following error:

SubCode=40000. Failed to validate credentials with GCM. Error is The remote server returned an error: (401) Unauthorized...TrackingId:410c0e33-0c38-1823-8a62-2519627c76a2_M1_G19,TimeStamp:9/19/2014 10:08:32 AM

We have setup our GCM API key to allow any IP address and we have also tried registering from code like below but with the same error:

  NamespaceManager mgr = NamespaceManager.CreateFromConnectionString(conn);
  var hub = mgr.GetNotificationHub("<hubname>");


  hub.GcmCredential = new GcmCredential("<apikey>");
  mgr.UpdateNotificationHub(hub);

Are we missing something quite obvious here?

user351711
  • 3,171
  • 5
  • 39
  • 74

4 Answers4

8
SubCode=40000. Failed to validate credentials with GCM.

This will probably fix this error:

Under the SERVICES tab in the APIs console for Google devs:

  • enable Google cloud messaging for android
Mihai Maruseac
  • 20,967
  • 7
  • 57
  • 109
CrusherJoe
  • 141
  • 4
  • 5
  • Rock star this will work 100% but for more clear I have post a new answer, cause cant attache picture over here. Thanks Crusher... ! – PEO May 20 '16 at 03:35
3

I recently had this problem and what I found was that I needed to go to the new firebase console, import my existing google project.

Once I had done that I could go to the settings cog in the top left->project settings. Then click on the cloud messaging tab then get the new server key. Once I entered that I was good to go in the notification hub.

Y8sy
  • 245
  • 2
  • 9
2

CrusherJoe is 100% correct but if some one need more clear picture here I have attached the screenshot. just go to the link and enable it. enter image description here

PEO
  • 185
  • 2
  • 13
0

Some users may not have verified or registered domain.

With the help of webmaster Tools u can verify and register your domain.

Go to Google Dev Console -> your project ->API's and Auth -> Push -> Click on Learn more for webmaster

Ajay Takur
  • 6,079
  • 5
  • 39
  • 55