我想向 firebase 身份验证添加一个新数据,其中包含显示名称、电话号码、图像等数据。但我想添加更多这样的性别、生日等等。是否可以添加新的?
最佳答案
无法向 Firebase 身份验证用户配置文件添加任意附加数据。如果需要,请考虑使用 Firebase 实时数据库(或 Cloud Firestore)来存储附加信息。
这种方法在过去的很多问题中都有涉及,所以我会把你链接到那些:
- > Firebase: setting additional user properties
- > Add extra User Information with firebase
- > How do I link each user to their data in Firebase?
- > Swift & Firebase - How to store more user data other than email and password?
- > Store additional information during registration with Firebase in Android
- > How to add additional information to firebase.auth()
从几周前开始,您可以向 Firebase 身份验证用户配置文件添加少量信息。虽然这听起来像是您需要的,但它显然不是用于存储您需要的用户元数据。相反,这是为了存储所谓的声明:关于您随后在安全规则中访问的用户的属性。查看documentation for setting custom claims .
关于javascript - 向 firebase 用户添加新数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46657445/