什么是“serviceAccountKey.json”请参阅Firebase设备到设备通知教程 [英] what is "serviceAccountKey.json" referring to in the Firebase device-to-device notifications tutorial

查看:1103
本文介绍了什么是“serviceAccountKey.json”请参阅Firebase设备到设备通知教程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设法完整地阅读了完整的 Firebase Android Codelab 问题,该应用程序完美的作品。现在我想添加设备到设备的通知。我发现了本教程
还有一些事情并不清楚。


  1. 在节点脚本中有这样的一行:

  2. ol>

    var serviceAccount = require(path / to / serviceAccountKey.json);



    什么是ServiceAccountKey.json文件?它只是google-services.json的另一个名称吗?如果没有,这是什么?


    1. 有没有简单的点击教程如何部署节点服务器代码到google的环境中?


    解决方案

    在您关注的博客文章中,使用Firebase Admin SDK在Google Cloud的App Engine灵活环境中运行node.js脚本。服务帐户是让受信任流程访问Google云端平台和Firebase资源的一种方式。




    I managed to go through the complete Firebase Android Codelab without too much problem, the app works perfectly. Now I would like to add device-to-device notifications. I found this tutorial: And some things are not clear to me.

    1. In the node script there is a line like this:

    var serviceAccount = require("path/to/serviceAccountKey.json");

    What is the "ServiceAccountKey.json" file? Is it just another name for google-services.json? If not, what is this?

    1. Is there a simple "click through" tutorial how to deploy the node server code to the google environment?

    解决方案

    In the blog post you're following, we're running the node.js script on Google Cloud's App Engine Flexible Environment using the Firebase Admin SDK. A service account is a way to give trusted processes access to Google Cloud Platform and Firebase resources.

    You create a service account through the Google Cloud Console and then download the corresponding JSON file. The code in the blog post looks for that file and use it to initialize the Firebase Admin SDK.

    这篇关于什么是“serviceAccountKey.json”请参阅Firebase设备到设备通知教程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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