有什么方法可以在 Firebase 控制台中为 FCM(云消息部分)重新生成 API 密钥?该密钥不可编辑,并且与 Google API 控制台中自动生成的密钥不同.由于这种错误配置,我总是从 FCM 收到 unauthorized 401...
更新:即使在 FCM Token 可见的 Cloud Messaging Tab 的新 UI 中,Regenerate Key<如果服务器密钥被删除,/kbd> 按钮仍然可见.
更新:现在似乎可以通过 Firebase 控制台重新生成服务器密钥,但是,标签/按钮(见屏幕截图)仅在没有使用服务器密钥时显示.
点击Regenerate Key后,会生成一个新的Server Key,在Google Developers Console中也可以看到.
仍然无法从 Firebase 控制台重新生成 API 密钥.但是,我能够通过开发者控制台重新生成它.
在与@SarthakMishra 讨论后,我再次浏览了控制台,并且能够真正重新生成在 Firebase 控制台中找到的 API 密钥.
首先,我将提供有关获取实际查看当前服务器密钥的部分的步骤.
从那里,您将能够看到服务器密钥和发件人 ID.
以下是重新生成服务器密钥的步骤.转到您的开发者控制台.
之后,您将能够看到当前可用于该项目的 API 密钥.通常,您会看到两个 API 密钥.一个 Server Key 和一个 Android Key,旁边有一个标签,上面写着(由 Google 服务自动创建).单击服务器密钥.
<块引用>
您想用新的密钥替换当前密钥吗?
新密钥将立即可用.当前密钥将在 24 小时后永久停用.
之后,您将看到生成的新服务器密钥.返回到可以看到服务器密钥和发件人 ID 的页面并刷新它.它应该与生成的新服务器密钥匹配.
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...
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.
这篇关于Firebase 云消息传递 API 密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!