Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

175
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!