检索使用 Firebase Auth 注册的用户列表 [英] Retrieving a list of users who have registered using Firebase Auth
问题描述
我正在使用 firebase 制作一个 android 聊天应用程序.到目前为止,我已经制作了一个常见的群聊应用程序.现在我想让它成为一个单独的聊天应用程序,它将有一个用户列表,当我们从该列表中选择一个人时,我们可以与他/她单独聊天.但是我无法从 Firebase 获取此用户列表.我在 Firebase 身份验证 UI 中保留了 Google 登录和电子邮件登录选项.任何帮助将不胜感激
I am making an android chat application using firebase. So far I have made a common group chat app. Now I want to make it an individual chat app, which will have a Users list and when we select a person from that list we can chat individually with him/her. However I am not able to get this Users list from Firebase. I have kept Google Sign in and Email sign in options in the Firebase Auth UI. Any help would be appreciated
推荐答案
如果您需要通过 uid
、email
或 phoneNumber
查找用户,您可以使用 Admin SDK 来执行此操作:
If you need to lookup users by uid
, email
or phoneNumber
, you can use the Admin SDK to do so:
https://firebase.google.com/docs/auth/admin/管理用户
您甚至还可以下载所有用户:https://firebase.google.com/docs/auth/admin/manage-users#list_all_users
You also even have the ability to download all your users: https://firebase.google.com/docs/auth/admin/manage-users#list_all_users
您需要从 Node.js 后端服务器或通过带有 Firebase 函数的 HTTP 端点执行此操作.
You would need to do that from a Node.js backend server or via HTTP endpoints with Firebase Functions.
此外,Admin SDK 允许您设置自定义用户属性,如果您想创建不同的用户组,这可能会很有帮助:
In addition the Admin SDK allows you to set custom user attributes which could be helpful if you want to create different user groups:
https://firebase.google.com/docs/auth/admin/自定义声明
admin.auth().setCustomUserClaims(uid, {groupId: '1234'})
这篇关于检索使用 Firebase Auth 注册的用户列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!