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

180
Vistas
React-Native: Mark chat messages as read on backend

I'm working on a react-native chat with laravel backend (I'm using Laravel Websockets/Pusher).

In the backend I my messages model has a isRead boolean field, I'm having problems finding a way to correctly mark chat messages as read, for example when a user navigates to chat screen I fire axios to get messages and check if there are unread messages, then I mark them as read if needed.

But how can I mark as read messages that were sent when the receiving user was looking at the chat screen? Is there a client event for that, how can I deal with this?

My chat screen is a simple Flatlist.

<FlatList ref={flatListRef} 
              vertical={true} onScroll={handleScroll} onEndReachedThreshold={0.5} onEndReached={markChatMessagesAsRead} showsVerticalScrollIndicator={false} style={{ flex:1,padding:15}} data={messages} keyExtractor={item => item.id.toString()}
            renderItem={({ message, index }) => 
              <View  style={{width:'100%',flexDirection:'row', ...index == messages.length-1 ? {marginBottom:100} : {marginBottom:5}}}>
    <Text>{ message.body}</Text>
                   <Text>{ message.isRead }</Text>
              </View>}
            />
about 4 years ago · Santiago Trujillo
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