Adding users to firebase

夙愿已清 提交于 2019-12-25 14:02:30

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/31777630/adding-users-to-firebase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!