云消息传递不同的密钥

云消息传递不同的密钥

本文介绍了Firebase 云消息传递不同的密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Whats 是制作项目时在 google_services.json 文件中生成的当前密钥.当前密钥、Web API 密钥和服务器密钥有什么区别,在哪里可以找到当前密钥 FCM 控制台?我找不到它.

Whats is the current key generated in google_services.json file when making the project. What is the difference between current key, web API key, and server key, and where can I find current key FCM console? I cannot find it.

推荐答案

目前没有文档明确讨论 google-services.json 文件中的值.虽然这个答案几乎可以让您了解它是什么以及它的作用.

There is no documentation as of the moment that clearly discusses what values are found in the google-services.json file. Although this answerpretty much gives you an idea on what it is and what it does.

至于您要求的具体细节:

As for the specific details you were asking for:

  • current key - 文档中没有明确说明使用它的任何地方,但是,在 google-services.json 最初用于的 3 个服务中在 Firebase(Google 登录、分析、GCM)之前,我猜它会在 Google 登录和分析之间.正如@DiegoGiorgini 这里所提到的:
  • current key - nothing is explicitly stated anywhere in the docs where it is used, however, among the 3 services where the google-services.json was originally used for before Firebase (Google Sign-in, Analytics, GCM), I'm guessing it would be between Google Sign-in and Analytics. As also mentioned by @DiegoGiorgini here:

FCM 不使用 google-services.json 中的 api_key 值.(它被其他 Firebase 库使用)

因此它可以用于单独的 Google 非 Firebase 或 Firebase 服务.

So it can be for a separate Google non-Firebase or Firebase service.

  • Web API Key - 这个我以前没有机会使用过.但是,我看到过其他帖子,其中这个特定的 API 密钥经常用于与 Firebase 相关的 Web 应用程序(可能也用于身份验证?),但我并不完全确定.

  • Web API Key - this one I haven't had a chance to use before. However, I've seen other posts wherein this specific API key is used often on Web apps related to Firebase (possibly also for Auth purposes?), but I'm not entirely sure.

服务器密钥 - 根据 文档:

授权您的应用服务器访问 Google 服务的服务器密钥,包括通过 Firebase Cloud Messaging 发送消息.

我还尝试在 Firebase 控制台中查看当前密钥可见的位置,但它似乎不存在.

I also tried to look around the Firebase Console on where the current key is visible, but it doesn't seem to be there.

这篇关于Firebase 云消息传递不同的密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 15:42