Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

156
Vistas
I want to reflect real time changed user nickname when chatting?

The previous chat data contains the pre-change nickname, so it is not reflected in real time when changing the nickname. What method should I use to make the nickname change in real time even the chat before changing the nickname?.

Do I have to change the nickname information in the chat data every time I change my nickname?

Firebase.usersRef
  .doc(Firebase.currentUser.email)
  .update({'nickname': nickname})
  .then(() ⇒ {
    Firebase.chatsRef
      .where('user.name', '==', Firebase.currentUser.email)
      .get()
      .then((querySnapshot) ⇒ {
        querySnapshot.forEach(doc ⇒ 
          // Changing the nickname
        )
      })
  })
  .catch(err => console.log(err));
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You should identify the user for each chat message by a so-called stable identifier, which apparently their nickname is not in your case.

Given that you seem to be using Firebase Authentication, the most common stable identifier for a user is their UID, which you can get with Firebase.currentUser.uid. So in addition to the nickname for the user, also store their UID in each document. Then use the UID for selecting the messages for a user, and use the nickname only to display in the UI,

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda