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

查看:75
本文介绍了向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: 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身份验证用户配置文件添加少量信息.尽管这听起来像您的需求,但它明确地不是,意在存储所需的用户元数据.而是用于存储所谓的Claims:有关您随后在安全规则中访问的用户的属性.请参阅用于设置自定义声明的文档.

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天全站免登陆