Firebase云消息传递不同的密钥 [英] Firebase Cloud Messaging different keys

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

问题描述

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

解决方案

目前还没有任何文档可以清楚地讨论 google-services.json 文件。虽然这个回答
几乎让你知道它是什么以及它是干什么的。



至于你所要求的具体细节:


  • 当前键但是,在Firebase之前最初使用 google-services.json 的3个服务中, em> Google登录,Google Analytics,GCM ),我猜这是在Google登录和Google Analytics之间进行的。正如@DiegoGiorgini所述:这里




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

因此,您可以使用单独的Google非Firebase或Firebase服务。




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


  • 服务器键 - 根据 docs

    $ b


    授权您的服务器密钥用于访问Google服务的应用服务器,包括通过Firebase云消息传递发送消息。


    我也尝试过在Firebase Console当前键是可见的,但似乎并不存在。


    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.

    解决方案

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

    As for the specific details you were asking for:

    • 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:

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

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

    • 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.

    • Server Key - as per the docs:

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

    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云消息传递不同的密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆