如何将 Firebase Admin SDK 添加到 Google 云平台并与应用程序通信?

How to add Firebase Admin SDK to a Google Cloud Platform and communicate with an app?

我一直在制作一个 Android 应用程序,该应用程序要求某些用户在登录时进行管理控制。我已经研究了这是如何实现的,并且发现它需要使用 Firebase Admin SDK 运行宁在服务器上。现在我遇到的问题是如何实际设置它以与我的应用程序通信?

这是我第一次尝试制作 android 应用程序并使用服务器。我已经阅读了 documentation,但这仍然没有让我清楚我需要的组件以及如何将它们拼凑在一起。目前我已经准备好了...

...但现在我需要了解如何在我的 Google 云功能上 运行 admin SDK 并在我的 android 应用程序中使用它进行授权。非常感谢对有用文档的任何建议或指导!

如果您以前从未做过这样的事情,我建议您从 callable Cloud Functions 开始。该文档有一个很好的示例,说明如何实现这些并从您的 Android 代码中调用它们。

在 Cloud Function 中,您可以使用 Admin SDK 访问例如 Firebase 身份验证。请参阅文档 importing the required modules for an example of how to set up the Admin SDK, and then the documentation of the Admin SDK for an example of how to get a list of users