Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

176
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda