简体   繁体   English

将 FCM API 密钥添加到 Azure 通知中心时出错

[英]Getting an error while adding FCM API Key to Azure Notification Hub

I have created a Azure Notification hub namespace, I'm trying to configure the Google FCM section of it by entering the API Key, but when I do that it is giving me this error我已经创建了一个 Azure 通知中心命名空间,我正在尝试通过输入 API 密钥来配置它的 Google FCM 部分,但是当我这样做时它给了我这个错误

Error updating notification hub {"error":{"code":"BadRequest","message":"Invalid Firebase credentials."}}更新通知中心时出错 {"error":{"code":"BadRequest","message":"Invalid Firebase credentials."}}

The Key I added it from the google-services.json file我从 google-services.json 文件中添加的密钥

But when I send a notification from FCM console, I'm able to send it and receive the notification.但是当我从 FCM 控制台发送通知时,我可以发送并接收通知。

Any inputs would be appreciated任何输入将不胜感激

Azure Notification Hub doesn't support FCM (yet) but GCM as I'm writing those lines. Azure Notification Hub(尚)不支持 FCM,但在我编写这些行时支持 GCM。 You need to mention the server key available under your Firebase project settings in the Cloud Messaging tab.您需要在 Cloud Messaging 选项卡中的 Firebase 项目设置下提及可用的服务器密钥。 You should see something like this:您应该看到如下内容: Firebase 项目设置

The key that you want to mention in Azure Notifications Hub is the purple one.您要在 Azure 通知中心提及的键是紫色键。

If Cloud Messaging API (Legacy) is disabled ( which should be the case by default since it's deprecated ), just hit the 3 vertical dots on the right and navigate to the only available menu "Manage API in Google Cloud Console".如果 Cloud Messaging API (Legacy) 被禁用(默认情况下应该是这种情况,因为它已被弃用),只需点击右侧的 3 个垂直点并导航到唯一可用的菜单“在 Google Cloud Console 中管理 API”。 And just enable it :)只需启用它:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM