将用户添加到Firebase [英] Adding users to firebase

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

问题描述

将用户添加到Firebase中遇到了一些问题。如果有人能帮助我,这将是显而易见的。

这是我的代码:

<$ p $ b $ myRootRef.createUser(emailSignUpEntered,password:passwordSignUpEntered,
withValueCompletionBlock:
myRootRef = Firebase(url:https://plattrapp.firebaseio.com/users)
myRootRef.createUser {错误,导致

如果错误!= nil {
//创建帐户
时出错} else {
let uid = result [uid ] as?String
println(用uid成功创建用户帐户:\(uid))
}
})
pre>

它在我的调试器的println语句中显示已经创建了一个用户,但实际上并没有显示在我的firebase数据库中。



任何我可能做错的事情?

解决方案

Firebase Authenticati on不会自动在关联的数据库中创建关于用户的任何信息。

大多数应用程序最终都会从顶级用户节点下自己的代码创建这些信息。这部分内容在存储用户数据部分适用于iOS的Firebase编程指南

阅读您正在开发的主题的Firebase文档通常是一个好主意。这将防止大量灰色/丢失头发和浪费时间。

I'm having a bit of trouble adding users to Firebase. If anyone could help me out with this, it would be significantly appreciated.

Here is my code:

var myRootRef = Firebase(url:"https://plattrapp.firebaseio.com/users")
        myRootRef.createUser(emailSignUpEntered, password: passwordSignUpEntered,
            withValueCompletionBlock: { error, result in

                if error != nil {
                    // There was an error creating the account
                } else {
                    let uid = result["uid"] as? String
                    println("Successfully created user account with uid: \(uid)")
                }
        })

It does display in the println statement within my debugger that a user has been created, but doesn't actually display within my firebase database.

Anything I may be doing wrong?

解决方案

Firebase Authentication does not automatically create any information about the user in the associated database.

Most applications end up creating this information from their own code under a top-level users node. This is covered in the section called "Storing User Data" in the Firebase programming guide for iOS.

It is in general a good idea to read the Firebase documentation on the topic that you are working on. It will prevent a lot of grey/lost hair and wasted time.

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

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