android - Firebase 云消息传递不同的 key

标签 android firebase firebase-cloud-messaging google-play-services

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

最佳答案

目前没有文档清楚地讨论在 google-services.json 文件中找到的值。虽然这answer 几乎可以让您了解它是什么以及它的作用。

至于您要求的具体细节:

  • current key - 在使用它的文档中没有任何明确说明,但是,在 google-services.json 最初用于的 3 个服务中在 Firebase 之前(Google 登录、Analytics、GCM),我猜它会在 Google 登录和 Analytics 之间。正如@DiegoGiorgini 也提到的 here :

The api_key value in google-services.json is not used by FCM. (it is used by other Firebase libraries)

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

  • Web API Key - 这个我以前没有机会使用过。但是,我看过其他帖子,其中这个特定的 API key 经常用于与 Firebase 相关的 Web 应用程序(可能也用于 Auth 目的?),但我不完全确定。

  • 服务器 key - 根据 docs :

A server key that authorizes your app server for access to Google services, including sending messages via Firebase Cloud Messaging.

我还尝试环顾 Firebase 控制台,看看当前 key 在哪里可见,但它似乎不在那里。

关于android - Firebase 云消息传递不同的 key ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40357782/

相关文章:

java - "Unable to find method ' 'void org.apache.commons.compress.archivers.zip.ZipFile.<init>(java.nio.channels.SeekableByteChannel)' '"

java - 在 Java/Android 中知道一个文件是否是图像

android - ADB 在 android studio 1.2 中没有响应?

Android Firebase 身份验证

ios - iOS swift 中的 Firebase 查询

android - 如何在 android 库模块中包含 GCM/FCM?

iOS 未收到来自 Firebase 云消息传递的通知

node.js - 带有前缀的 Node JS 谷歌云消息传递主题出现错误 : Malformed topic name

firebase - 为什么有时imageUrl被保存在Cloud Firestore数据库中而有时却不保存

firebase - 如何在firebase读取API中调用yield