检索使用Firebase Auth注册的用户列表 [英] Retrieving a list of users who have registered using Firebase Auth
问题描述
我正在使用Firebase制作一个android聊天应用程序.到目前为止,我已经制作了一个普通的群聊应用.现在,我要使其成为一个单独的聊天应用程序,它将具有一个用户"列表,当我们从该列表中选择一个人时,我们可以与他/她单独聊天.但是,我无法从Firebase获取此用户列表.我在Firebase身份验证用户界面中保留了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屋!