Cordova API Offline

Asked

Viewed 40 times

2

I’m not sure what I want to do is possible. So I was wondering if you could help me?

I’m building an app that will consume a Rest API for product listing. I need to make sure that on first access it caches these items to consume when offline. How to do it? Can you help me with some example or links where I can get some example to better understand how to do?

  • Search for Service Worker

1 answer

0

What you’re looking for is plugin apache-Cordova for localStorage.

With localStorage you now have a local database in your app, this way you can upload this data of which you mentioned, in this local database, and access and edit them at the time that may be opportune.

This Link, is the documentation of how to use the localStorage native of apache-crodova.

This other link, shows other options with Storage, also native apache-Cordova.

All these above options, work with the device’s native Storage.

I use a more advanced solution with Sqlite, which is a proper database for mobile apps. I like it because the other options can limit the size of my Storage, whereas Sqlite this resource management is better.

This plugin is very good, even is indicated on the site of apache-Cordova.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.