- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想向 Firebase 用户对象添加一个属性。 user documentation说我只能使用 Firebase 实时数据库存储其他属性。
我不确定 这是如何工作的在实践中。
以下在实践中意味着什么?
You cannot add other properties to the Firebase User object directly; instead, you can store the additional properties in your Firebase Realtime Database.
var userRef = ref.child("users");
userRef.set({
newfield: "value"
});
最佳答案
您快到了。在旧版 Firebase 文档中,我们有一个关于 storing such additional user data 的部分。 .
关键是将附加信息存储在用户的uid
下:
let newUser = [
"provider": authData.provider,
"displayName": authData.providerData["displayName"] as? NSString as? String
]
// Create a child path with a key set to the uid underneath the "users" node
// This creates a URL path like the following:
// - https://<YOUR-FIREBASE-APP>.firebaseio.com/users/<uid>
ref.childByAppendingPath("users")
.childByAppendingPath(authData.uid).setValue(newUser)
关于javascript - 火力基地 : setting additional user properties,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37415863/
我正在使用 Firebase 在我的应用程序中添加登录/注册。它运行良好,但现在我想检查用户在打开应用程序时是否已经注册并登录,如果是这样,则向他显示主页,否则向他显示登录页面。所以我做了一些搜索,主
我使用 flutter 。我想仅在 2020 年 4 月 26 日这一周将 Firebase 中的 CH 值更新为 false。什么时候有办法? 失败的 Ex.cord: _firestore.col
我来寻求您对我的申请中遇到的问题的帮助。 问题是这样的:新闻源上的帖子位于此捕获中的此帖子 -> [postid] 位置下的数据库中 ,当用户保存帖子时,它在数据库中的存储方式如下:用户 -> [us
我是一名优秀的程序员,十分优秀!