0

I am working with Android GCM. My application is live and it contains hundreds of users. I am using back-end of .NET (SOAP services with MS-SQL).

I've now accidentally deleted my GCM Server Key from Google Developers Console. Now, I am trying to send a notification, but it's showing a not authorized error response.

Help me. How to send notifications now? I don't wanna lose my users. That's why new Server Key is not an option for me. If you've good solution, please let me know. Thanks.

AL.
  • 36,815
  • 10
  • 142
  • 281
Zeeshan Ali
  • 2,211
  • 4
  • 18
  • 25

1 Answers1

0

So just to stress on it, there is no way to recover a deleted Server Key. Before even deleting a Server Key in the Google Developers Console, a dialog appears saying:

This credential will be deleted immediately and permanently. Once deleted, it can no longer be used to make API requests.


I don't wanna lose my users.

You only deleted the Server Key which is used for Authorization. The 401 error is only an auth error that says that your sender has a problem authenticating. Not the end of a project.

You don't lose the users so long as you still have the registration tokens and it's corresponding Sender ID(s) exists.

The way that you have to do this now is for you to import your Google Developer Console project to Firebase Console, since as mentioned in the docs:

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.

Steps on how to import your project is like so:

  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.

401 Authorization error is so common this past few months. Don't panic. See my answer here.

Community
  • 1
  • 1
AL.
  • 36,815
  • 10
  • 142
  • 281
  • Thanks @AL. It helps me in getting Server Key. But now when I am trying to send notification, its saying Not Registered Error. – Zeeshan Ali Oct 21 '16 at 09:42
  • @FarhanAli That's a separate concern and is a quite common concern here . Try to look around for similar issue and also refer to the error link I mentioned above. See if it matches your scenario. – AL. Oct 21 '16 at 09:53
  • Thank you so much. It resolved my problem. Thanks again! – Zeeshan Ali Oct 21 '16 at 10:05