Cordova plugin for automatically updating app assets (JS, CSS, etc.).
The plugin is configured with apps that should be automically updated. When the app starts or is re-activated, it will:
- Check local storage
- Check static assets (from
www/
folder) - Determine latest versions
- Send them to the server
- Download newer assets (if necesarry) and store them in local storage
- Load/inject the latest versions of JS/CSS
This auto update plugin requires a back-end for retrieving the latest assets. It will send the local versions to the back-end (GET request) and check if new assets should be downloaded:
http://127.0.0.1:9001/?v[css/main.css]=0.1.0&v[js/main.js]=0.1.0
The server can then respond with newer versions:
{
"js/main.js": {
"url": "http://127.0.0.1:9001/release/js/main.0.1.1.js",
"version": "0.1.1"
}
}
- Install plugin:
cordova plugin add https://github.com/TapmeMedia/cordova-plugin-autoupdate.git
- Set up server
- Configure plugin
- Build and run app