我在我的应用中使用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的密钥的用户根节点$ 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如何获取用户详细信息?
发布评论