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/