使用 firebase 添加额外的用户信息 [英] Add extra User Information with firebase
问题描述
我已将 Firebase 身份验证与我的 android 应用程序集成在一起.假设用户有一个邮件 abc@abc.com
.我想向用户添加一些额外的信息,例如用户的姓名、职业和地址.我如何将用户身份验证表与我的 android 应用程序连接来做到这一点?
I have integrated firebase auth with my android app. Lets say a user has a mail abc@abc.com
. I want to add some extra information to the user like the name of the user, occupation and address. How can i connect the user auth table with my android app to do that?
我需要为此编写任何 API 吗?
Do i need to write any APIs for that?
推荐答案
首先,在 db 中创建一个 users
目录.然后,使用从身份验证过程中获得的用户唯一 ID,将用户信息存储在 users/{userid}
下.
First, create a users
directory in db. Then, using user's unique id you get from authn process, store the user info under users/{userid}
.
要实现这一点,您需要了解 Firebase 数据库的详细信息.请参阅此处:https://firebase.google.com/docs/database/android/保存数据
To achieve this, you need to get into the details of Firebase database. See here: https://firebase.google.com/docs/database/android/save-data
这篇关于使用 firebase 添加额外的用户信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!