Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding Google GCM Api Key Azure Notification Hub Error

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?

like image 755
user351711 Avatar asked Dec 12 '22 03:12

user351711


1 Answers

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
like image 109
CrusherJoe Avatar answered Dec 14 '22 21:12

CrusherJoe