Firebase:从UID获取DisplayName [英] Firebase: Get DisplayName from UID

查看:112
本文介绍了Firebase:从UID获取DisplayName的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将用户的显示名称存储在Firebase身份验证中。从同一用户登录时,从Firebase Auth进行提取很简单。但是,当其他用户登录时,如何获取帐户的显示名称,具有唯一的UID(用户ID)。
你不能



解释在这里如果我返回一个用户列表使用Firebase简单用户名&密码认证



您可以改为将用户的uid设置为数据库中的用户节点,我使用该节点存储其他用户的信息。那么你可以得到这个节点下的孩子数。


I am storing user's display name in Firebase Auth. Fetching from Firebase Auth is simple when the same user is logged in. But, when another user is logged in, how do I fetch an account's display name when I have their unique UID (User ID).

解决方案

You can't

The explanation is here How do I return a list of users if I use the Firebase simple username & password authentication

You can instead set the user's uid to users node in your database, I use that node to store other user's information. then you can get the number of childs under that node.

这篇关于Firebase:从UID获取DisplayName的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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