Ionic offline


#1

I have an app created in Ionic and all information is currently online on a server and the app makes the request, the server returns the data, mounts the page and Ok. But it will come to a point where some of that information should be shown offline. Is it possible / feasible because of internet limitations to write some of this data online in offline storage or in a SqLite so that they can access some information?
Or do you have ways to feed this storage or Sqlite automatically from this mysql online?

Thanks


#2

hi Cj10

Exist a command that detect when the app is offline or online:
put the code in directives

 document.addEventListener("offline", onOffline, false);
  function onOffline() {
     // Handle the offline event
  }
document.addEventListener("online", onOnline, false);
    function onOnline() {
        // Handle the online event
  }

u can put that save ur information in a array of localstorage and when the internet return if the array containts information u can save to mysql


#3

Nice. Do you have any examples or tutorials that I can follow to implement this functionality?
Thanks.