I want to create kind of registration without password and email. I use only nickname. So,I have a User class that has nickname field and other fields. So, I want to push new user and the thing that I want is to save its key because I will need it in the future when I have to get some user's data. So how can I get a key of an object that was already pushed?
Here is my code how I push:
User user = new User() ;
user.setNick(nick.getText().toString());
user.setScore(0);
Firebase fire = new Firebase(FirebaseConfig.URL) ;
//how to get key of this object? Is it possible before pushing?
fire.push().setValue(user);