【发布时间】:2017-06-11 00:45:52
【问题描述】:
目前我正在使用此代码将我的用户类添加到 firebase 数据库:
public void onClick(View v)
{
Firebase ref = new Firebase("https://xxxxxx.firebaseio.com/");
createAccount(emailString, passwordString);
User user = new User ();
user.setEmail(emailString);
user.setPassword(passwordString);
ref.child("users").push().setValue(user);
}
现在,由于我使用 .push() 方法,我正在我的数据库中创建一个唯一 ID。如何提取该唯一 ID?我查看了this 教程,但我不明白如何实现它。
【问题讨论】:
-
我认为您正在尝试将 android 与 javascript 结合起来。查看文档:firebase.google.com/docs
-
嗯。我想你是正确的。谢谢