Handle internet connection on my phonegap app

  • 1
  • Problem
  • Updated 4 years ago
Please i am using pure html, css and javascript and am using phonegap build, how will i be able to handle internet connection on my app. Am using a web service for my application and when their is no internet connection i will like to load another url asking them to get an internet connection but i cant do that because i cannot access the manifest file. Please advice. Thank you.
Photo of desmond

desmond

  • 8 Posts
  • 0 Reply Likes

Posted 4 years ago

  • 1
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
Why would you want to edit the manifest file?

One option would be to track the online/offline events. When the device goes offlne, you immediately show the 'I am offline' page. When the device goes online, you return to the previously displayed document. When doing so, you can always access your web service using an ajax/xhr request.

For the online/offline event, you need the plugin
https://github.com/apache/cordova-plu...