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

174
Vistas
online/offline eventListener in cordova inconsistent

I'm on a project which uses react inside cordova.

I've installed cordova-plugin-network-information plugin at the root level (cordova part) and using below inside useEffect but the behaviour of the event listener is very inconsistent within the app.

I tried with window.addEventListener as well but it is not working on the ios simulator. Although, it works if I run the app on the react side directly. (go to react folder and run on the browser)

By very inconsistent -> sometimes it works well (detect online/offline correctly), sometimes it works opposite (detect as offline when online and online when offline), and sometime it doesn't detect at all.

document.addEventListener("online", handleOnLine, false);
document.addEventListener("offline", handleOffLine, false);

I'm not sure what is wrong with the implementation since I've researched about this and everyone seems to be not having an issue but me and my coworkers are having same issues.

about 4 years ago · Juan Pablo Isaza
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