0

We have been using GCM to send Push notifications for a long time, in the past days, the sending log starts give me the error:

The Push Notification System rejected the request because of an invalid credential

After searching on the web, it seems that a Server API Key is now required to get service working again.

The API Key was created and restricted to IP of my production server on Amazon.

When I try to register the Server API Key in Azure GCM, I got an error 401 unauthorized.

Can anyone give me any suggestion? I don't know what to do anymore, my users can't access our system because authentication token is not being sent. Thanks.

Screen errors: Server API Key Azure GCM Error

AL.
  • 36,815
  • 10
  • 142
  • 281

1 Answers1

1

There is now a visible note in the GCM docs saying:

Starting from Sept. 2016 new server key can only be created in the Firebase Console using the Cloud Messaging tab of the Settings panel. Existing projects that need to create a new server key can be imported in the Firebase console without affecting their existing configuration.

Migrating from GCM to FCM fixes the issue for 401 Unauthorized Error.

If you are just starting to use GCM, instead of creating a project in the Google Developers Console, do it in the Firebase Console. After creating the project, simply use the auto-generated Server Key. Here are the steps where to find the Server Key:

  1. Go to your Firebase Console and click on CREATE NEW PROJECT.
  2. Fill in your desired Project Name and select your Country. After this, the new Project should be active.
  3. Then on left-side panel, click on the gear button and select Project Settings.
  4. Then go to the Cloud-Messaging Tab.

For old GCM projects, you can simply Import the project to the Firebase Console:

  1. Go to your Firebase Console and click on IMPORT PROJECT.
  2. Select the project you want to import and your country.
  3. Click on ADD FIREBASE. After this, the new Project should be active.
  4. Then on left-side panel, click on the gear button and select Project Settings.
  5. Then go to the Cloud-Messaging Tab.

See my answer here for more details.

Community
  • 1
  • 1
AL.
  • 36,815
  • 10
  • 142
  • 281
  • Hi ! Very thanks for you help ! The new FCM Server API Key was succesfully registered in Azure GCM When I try send a test notification it now give me a diferent error message : "The Token obtained from the Token Provider is wrong" Just started looking for something about this... Is it a nkow problem ? Thanks, Marco Borsoni. – Resolve Informatica Oct 09 '16 at 13:28
  • @ResolveInformtica Hi Marco. So sorry for not getting back to you in this post. Were you able to resolve your issue? If not, could you provide more details? – AL. Apr 27 '17 at 12:55