我们正在使用 Urban Airship 向我们的 Android 应用程序发送推送消息。 在这个过程中,我们需要使用 Firebase 控制台 -> 云消息传递 中提供的 '服务器密钥' 配置 Airship。 如建议所述,我们正在尝试从 GCM 迁移到 FCM。 问题是 '服务器密钥' 在 'Firebase Cloud Messaging API (V1)' 配置中缺失。 它仍然在 'Cloud Messaging API (Legacy)' 配置中可用,但建议进行迁移。 按照 FCM 配置中的链接对此问题没有太大帮助。
Firebase云消息现已转移到API(V1)。 因此,要获取serverkey,您应启用云消息API(Legacy)。 按照以下步骤进行: 点击三个点,然后在Google Cloud Console中点击“管理Api” 点击启用。 3.现在返回到主页面并刷新页面。 现在您有了自己的serverkey
为了访问服务器密钥,请按以下步骤操作: 像之前一样打开项目设置 打开 Firebase Cloud Messaging API 菜单(在 Enabled 右侧) 点击 "Manage API in Google Cloud Console",它会将您重定向到 Google Cloud Platform 在 Google Cloud Platform 上,您会看到 Firebase Cloud Messaging API,点击“Manage”即可进入 APIs & Services 点击屏幕左侧的“Credentials” 您会看到不同的表格。其中一个称为 API Keys,里面有一条名为 Server Key 的记录 点击“Show Key”,然后您就可以看到所需内容了 希望这能对您有所帮助。
从Firebase Cloud Messaging API (V1)开始,我们需要启用云消息服务。 打开项目设置 选择位于“Cloud Messaging API (Legacy)”右侧的三点菜单,点击“在Google Cloud Console中管理API” 在重定向的Google Cloud Console中启用云消息服务。 返回项目设置并刷新。现在您可以获得服务器密钥。 参考 - https://documentation.onesignal.com/docs/generate-a-google-server-api-key