Firebase如何获取用户详细信息? [英] Firebase how to get user details?

查看:409
本文介绍了Firebase如何获取用户详细信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用中使用Firebase身份验证,并使用电子邮件和密码注册用户。我想获得其他用户的详细信息(与登录用户分开),同时用户使用自己的帐户登录。如何获得这些信息?解决方案

I am using Firebase authentication in my app and signing up a user with email and password. I want to get other users details (separate from the logged-in user) as well while a user is signed in with their own account. How can I get that information?

像电子邮件,显示名称和id(特定于身份验证系统) Firebase用户对象。您可以从 FIRAuth课程获取对当前登录用户的引用。一>。我为iOS提供了链接和类名,但是其他平台的结构也是类似的。

Values like email, display name and id (specific to authentication system) are available off of the Firebase User object. You can get a reference to the current logged in user off of the FIRAuth class. I provided links and class names for iOS, but other platforms are similarly structured.

如果你想为用户存储额外的数据,我会建议包括一个<$ c $使用Firebase用户对象的 uid 作为用户根节点$ c>子节点。

If you want to store additional data for users, I would recommend including a users root node, using the uid off of the Firebase User object as the key for users child nodes.

这篇关于Firebase如何获取用户详细信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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