Ionic + Cordova & Offline mode

Hi Ionites !
First off let me thank again the amazing work the ionic team has been pulling off. It really brings the best of HTML/CSS/JS to everyone.

TL;DR: Is Ionic + Cordova able to offer a true offline experience ? for example, store requests until their is a connection, and act as if it went trough

I have a working Ionic app that allows users to rate the wine we sold them so that we can curate an awesome selection fitted to their tastes.

The basic flow is
They connect, scroll trough their winelist (fetched from our DB), choose a wine, rate it. It then goes into their RatedWineList.

I was told that only obj-C et iOS dev could help me achieve the same experience offline, and offer more performance.

The offline flow would be something along the lines of:
They connect using their previous session, scroll to their winelist (fetched from the previous session), choose a wine, rate it. It would then goes into their RatedWineList and the request would be cached for later.
Here, the UI is faking that the request is going through.

They could also scroll around and read about their wines and rated wines, or change previous rates.

What do you think ? Should I dive into iOS development or does it seem possible?

Thanks for your input
Félix

LocalStorage might help you. You could store the rate in localstorage, then when the app goes online again check if any rate is stored and send it to your server.

http://learn.ionicframework.com/formulas/localstorage/

1 Like

Agreed

I do something similar with localstorage (also look at localforage - can store in indexdb etc…).
You will have to role your own mechanism though.
The NetworkInfo plugin does work well in letting you know when the device goes offline (or online for that matter)
cheers

1 Like

Thanks guys, I’ll look into it.

1 Like

Good morning. Does the plugin NetworkInfo work on iOS devices?

Another option would be to use something like PouchDB. Obviously it might not suit the needs of the OP since you might be too far down the road… but I thought was worth posting anyway.

Some example apps are also available, such as this TODO app one.

Oh, just spotted this tutorial too http://devgirl.org/2014/12/30/sync-data-using-pouchdb-in-your-ionic-framework-app/