所以我有以下代码是从firebase文档中获得的(我已经在我的应用程序中实现了,并且可以正常工作):
So I have the following code that I got from the firebase documentation (which I implemented in my app already and it's working fine):
Firebase ref = new Firebase("myapp.firebaseio"); ref.createUser("bobtony@firebase", "correcthorsebatterystaple", new Firebase.ValueResultHandler<Map<String, Object>>() { @Override public void onSuccess(Map<String, Object> result) { System.out.println("Successfully created user account with uid: " + result.get("uid")); } @Override public void onError(FirebaseError firebaseError) { // there was an error } });创建用户后,它将在控制台上打印其uid.但是,当我输入myapp.firebaseio时,那里什么都没有..所以我有一些问题:
after I create a user it prints on the console its uid. However, when I enter in my myapp.firebaseio there is nothing there.. So I have some questions:
所以,我想做的是在onSuccess()里面,我使用了ref.push()到myapp.firebaseio的一些值,但是然后..我如何检查由createUser()创建的用户uid和我推过的那个一样吗? (ID是不同的!)
So, What I have tried to do was inside the onSuccess() I used ref.push() some values to myapp.firebaseio but then .. how can I check if the users uid created by the createUser() is the same as the one who I pushed? (the id's are differente!)
如果没有要求,我希望我的文字清楚,我可以尝试再次解释!
I hope my text it's clear, if isn't asked and I can try to explain again!
谢谢一堆!
推荐答案用户信息不存储在Firebase数据库中.对于匿名用户和OAuth用户,没有信息存储在任何地方.电子邮件和密码用户的信息保存在您无权访问的单独数据库中.电子邮件和密码用户在登录名"和收件人"中可见.当然,您的信息中心中的身份验证"标签并不在您的数据库中.
User information is not stored inside your Firebase database. For anonymous and OAuth users, no information is stored anywhere. The information for email+password users is kept in a separate database that you don't have access to. The email+password users are visible in the Login & Auth tab of your dashboard of course, just not in your database.
如果要将用户信息存储在自己的Firebase数据库中,则在创建或验证用户身份时必须将其自己存储在其中. 有关在Firebase文档中存储用户数据的部分显示该怎么做.
If you want to store user information in your own Firebase database, you have to store it there yourself when you create or authenticate the user. There is a section on storing user data in the Firebase documentation that shows how to do this.
必须自己存储信息的一个优点是,您可以准确确定存储的内容和未存储的内容.
One advantage of having to store the information yourself, is that you get to determine exactly what is and what isn't stored.
更多推荐
了解Firebase的createUser函数(特别是android库)
发布评论