getDisplayName() and getPhotoUrl() without signing in user to android firebase -


i creating login page in android using firebase email password authentication , want when user enters email address , shift password system automatically photourl , displayname , display on login page before user enters full password.

for want one way doing that:

so have in firebase database:

asdeyrdsdda    email: jonh@doe.com    display_name: jonh    photo_url: your_url werswersdfr    email: maria@doe.com    display_name: maria    photo_url: maria_url 

to data firebase need create reference that:

firebasedatabase database = firebasedatabase.getinstance();  databasereference myref = database.getreference("users"); 

and listener:

myref.addvalueeventlistener(new valueeventlistener() {                  @override                  public void ondatachange(datasnapshot datasnapshot) {                        for(datasnapshot data: datasnapshot.getchildren()){                                string email=data.child("email").getvalue(string.class);                                if (email.equals("jonh@doe.com")) {                                      //do ur stuff                                     string displayname=data.child("display_name").getvalue(string.class);                                     string photourl=data.child("photo_url").getvalue(string.class);                                 }                         }                   }                    @override                  public void oncancelled(databaseerror databaseerror) {                    }              }); 

so checks in childs if data want exists , if yeas whant.


Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

Ruby Google Calendar Integration Watch Event / Push Notification -