向 firebase 用户添加新数据 [英] Adding new data to firebase users

查看:42
本文介绍了向 firebase 用户添加新数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想向 Firebase 身份验证添加一个新数据,其中包含显示名称、电话号码、图像等数据.但我想添加更多这样的性别,生日等等.可以添加新的吗?

I want to add a new data to firebase authentication which has data like displayname, phone number, image. But i want to add more such gender, birthday and more. is it possible to add new?

推荐答案

无法向 Firebase 身份验证用户配置文件添加任意附加数据.如果需要,请考虑使用 Firebase 实时数据库(或 Cloud Firestore)来存储其他信息.

There is no way to add arbitrary additional data to Firebase Authentication user profiles. If you want that, consider using the Firebase Realtime Database (or Cloud Firestore) for storing the additional information.

这种方法在过去的很多问题中都有涉及,所以我将链接到这些问题:

This approach has been covered in quite a few questions in the past, so I'll link you to those:

几周前,您可以向 Firebase 身份验证用户配置文件添加少量信息.虽然这听起来像是您所需要的,但它明确用于存储您需要的用户元数据.相反,它用于存储所谓的声明:有关用户的属性,然后您可以在安全规则中访问这些属性.请参阅有关设置自定义声明的文档.

Since a few weeks ago you can add small bits of information to the Firebase Authentication user profile. While this might sound like what you need, it is explicitly not meant for storing user metadata such as you need. Instead this is intended for storing so-called claims: properties about the user that you then access in the security rules. See the documentation for setting custom claims.

这篇关于向 firebase 用户添加新数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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