Reputation: 4419
Any way to regenerate the API Key for FCM (Cloud Messaging section) in Firebase Console? The key is not editable and is different from the one automatically generated in Google APIs Console. Due to this misconfiguration I'm always getting unauthorized 401 from FCM...
Upvotes: 25
Views: 18296
Reputation: 37798
Update: Even with the new UI of the Cloud Messaging Tab where the FCM Token is visible, the Regenerate Key button would still be visible if the Server Key was deleted.
Update: It seems it is now possible to regenerate the Server Key via the Firebase Console, however, the label/button (see screenshot) only shows up when there is no Server Key being used.
After clicking on Regenerate Key, it will generate a new Server Key which is also visible in the Google Developers Console.
Still no way to re-generate the API Key from Firebase Console. HOWEVER, I was able to re-generate it via the Developer Console.
I went through the consoles again after having a discussion with @SarthakMishra and was able to actually re-generate the API Key found in the Firebase Console.
First, I'll provide the steps on getting to the part where to actually see the current Server Key.
From there, you will be able to see the Server Key and the Sender ID.
Here are the steps to re-generate the Server Key. Go to your Developer Console.
After that, you will be able to see the API Keys currently available for the project. Commonly, you will see two API Keys. One Server Key and one Android Key, where it has a label beside it saying (auto created by Google Service). Click on the Server Key.
Do you want to replace the current key with a new one?
The new key will be available immediately. The current key will be deactivated permanently in 24 hours.
After that, you will see the new Server Key generated. Go back to the page where you can see the Server Key and Sender ID and refresh it. It should match the new Server Key generated.
Upvotes: 22
Reputation: 1114
You dont need to regenerate the key .Follow the steps
Upvotes: 5
Reputation: 21
In the FCM console go to your project, there will be a overflow menu icon showing on the project name pop up, in the Overview pane. Click on that and Manage... on the opened page showing your apps, you would be able to download the google-services.json file which contains every detail like the current api-key, plus you can navigate to the Cloud Messaging tab where it will show your Server-Key.
Upvotes: 0