Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 228595

Can't get cordova network plugin to work

$
0
0

After spending 2 hrs, nothing worked for me. I have installed cordova network plugin, also checked my androidmanifest.xml file everything was as suggested by other users. What worked for, i am posting here

1) add below code to index.html

<script>
  window.addEventListener("online", function(e) {
    window.location = "#/app/home";
  }, false);

  window.addEventListener("offline", function(e) {
    window.location = "#/app/offline";
  }, false);
</script>

In offline template i am simply showing "No internet connection" mesage. As soon as you go online, it will open app home page. and when you go offline it opens offline page.


Viewing all articles
Browse latest Browse all 228595

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>