I want to get the same ID

Asked

Viewed 47 times

0

Good afternoon I wanted to know if it is possible to get the phone ID for the same functions or as in the example below. I want to put the ID that’s marked black under the "SMS". Is it possible to put? How can I do it? Below is the code.inserir a descrição da imagem aqui

private static final String TAG = FirebaseDatabaseHelper.class.getSimpleName();

private DatabaseReference databaseReference;

public TelaPolicia(){
  demoRef = FirebaseDatabase.getInstance().getReference();

}

public void createUserInFirebaseDatabase(String userId, FirebaseUserEntity firebaseUserEntity){
    Map<String, FirebaseUserEntity> user = new HashMap<String, FirebaseUserEntity>();
    user.put(userId, firebaseUserEntity);
    demoRef.child("SMS").setValue(user);
}
  • 1

    I don’t understand exactly what your problem is, but I notice you’re using setValue, this will remove all the information already contained in the 'SMS' node and put the current one, and from what you said there, that’s not what you want.

  • Also: Why did you put the javascript tag on your question? The question seems to be related to Android only.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.