VoyForums
[ Show ]
Support VoyForums
[ Shrink ]
VoyForums Announcement: Programming and providing support for this service has been a labor of love since 1997. We are one of the few services online who values our users' privacy, and have never sold your information. We have even fought hard to defend your privacy in legal cases; however, we've done it with almost no financial support -- paying out of pocket to continue providing the service. Due to the issues imposed on us by advertisers, we also stopped hosting most ads on the forums many years ago. We hope you appreciate our efforts.

Show your support by donating any amount. (Note: We are still technically a for-profit company, so your contribution is not tax-deductible.) PayPal Acct: Feedback:

Donate to VoyForums (PayPal):

Login ] [ Contact Forum Admin ] [ Main index ] [ Post a new message ] [ Search | Check update time | Archives: 123[4] ]


[ Next Thread | Previous Thread | Next Message | Previous Message ]

Date Posted: 03:47:09 05/13/21 Thu
Author: Romaguera
Author Host/IP: NoHost / 49.34.178.202
Subject: My FireBase Database doesn't save information

help me, please. Now I am working on my project and I need save information about my users. I chose Realtime Database, but it doesnt work. I have an exception:"This email is already in use", through I insert new email. I use everything(google.json, SHA-1, SHA-256), but my signing up new users doesnt work correctly. My rules:

{
"rules": {
".read": true,
".write": true
}
}

My class Person:

public String name, email;

public User(){}

public User(String name, String email){
this.name = name;
this.email = email;
}
}

My FireBaseAuth, FireBaseDataBase:


private FirebaseAuth mAuth;
private FirebaseDatabase usersDataBase;

///


mAuth.createUserWithEmailAndPassword(email, password)
.addOnCompleteListener(new OnCompleteListener() {
@Override
public void onComplete(@NonNull Task task) {
if(task.isSuccessful()){
User user = new User(username, email);

FirebaseDatabase.getInstance().getReference("Users")
.child(FirebaseAuth.getInstance().getUid())
.setValue(user).addOnCompleteListener(new OnCompleteListener() {
@Override
public void onComplete(@NonNull Task task) {
if(task.isSuccessful()){
Toast.makeText(RegisterActivity.this, "Пользователь успешно добавлен", Toast.LENGTH_SHORT).show();

startActivity(new Intent(RegisterActivity.this, SigningActivity.class));
}
else{
Toast.makeText(RegisterActivity.this, "Произошла ошибка! Пожалуйста, попробуйте позже", Toast.LENGTH_SHORT).show();
}
}
});
}
else {
Toast.makeText(RegisterActivity.this, task.getException().getMessage(), Toast.LENGTH_SHORT).show();
}
}
});

[ Next Thread | Previous Thread | Next Message | Previous Message ]


Replies:



[ Contact Forum Admin ]


Forum timezone: GMT-8
VF Version: 3.00b, ConfDB:
Before posting please read our privacy policy.
VoyForums(tm) is a Free Service from Voyager Info-Systems.
Copyright © 1998-2019 Voyager Info-Systems. All Rights Reserved.