private DatabaseReference reference = FirebaseDatabase.getInstance().getReference();
private void uploadDataDB() {
reference = reference.child("UserData");
final String unqKey = reference.push().getKey();
Calendar calendar = Calendar.getInstance();
@SuppressLint("SimpleDateFormat") SimpleDateFormat currDate = new SimpleDateFormat("dd-MM-yy");
String date = currDate.format(calendar.getTime());
Calendar calforTime = Calendar.getInstance();
@SuppressLint("SimpleDateFormat") SimpleDateFormat currTime = new SimpleDateFormat("hh-mm");
String time = currTime.format(calforTime.getTime());
UserData userData = new UserData(name, downloadUrl, date, time, unqKey, email, contact);
reference.child(unqKey).setValue(userData).addOnSuccessListener(unused -> {
Toast.makeText(USERLANDING.this, "data uploaded", Toast.LENGTH_SHORT).show();
}).addOnFailureListener(e -> {
Toast.makeText(USERLANDING.this, "something Upload data went wrong", Toast.LENGTH_SHORT).show();
});
}
And my database rules in the fire base are
{
“rules”: {
“.read”: true,
“.write”: true
}
}
I want to Know the reason behind the Not updating of my user data in my realtime Database