i'm working on Login and register activity using Firebase that requires me to strore data in realtime database. I setup the firebase realtime database location in South East Asia, and this is the supposed URL: https://chatapp-5e8ce-default-rtdb.asia-southeast1.firebasedatabase.app/
and this is my code on writing Users data on the DB, after succesfully creating user using .createUserWithEmailAndPassword(email, password) ==>>
myRef = FirebaseDatabase.getInstance().getReference("Users");
String currUserId = FirebaseAuth.getInstance().getCurrentUser().getUid();
User user = new User(username, "default");
myRef.setValue(user)
.addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if (task.isSuccessful()){
} else{
}
}
});
After debugging, i found that the process fails at myRef.setValue(user) because the URL set up for database reference is https://chatapp-5e8ce-default-rtdb.firebaseio.com/Users instead of https://chatapp-5e8ce-default-rtdb.asia-southeast1.firebasedatabase.app/Users.
How do i set the URL so it match my firebase database location?