cordova-plugin-wiaxy-auto
v0.1.0
Published
Cordova hot auto-update plugin for JS/CSS/HTML web assets.
Downloads
14
Maintainers
Readme
cordova-plugin-wiaxy-auto
Author: S Naziru Ahmad
Auto-update web assets (JS/CSS/HTML) with hot-reload in Cordova apps. This plugin downloads only the files your server returns as newer, saves them under the app storage (dataDirectory/Documents/www), and intercepts WebView requests to serve updated files — enabling hot-reload without a full app restart.
Quick usage
Install locally:
cordova plugin add /path/to/cordova-plugin-wiaxy-autoIn your app JS:
document.addEventListener('deviceready', function(){
AutoUpdate.checkAuto('https://your-server.com/check', {}, function(err, info){
if (err) console.error('update failed', err);
else console.log('update info', info);
});
});Server contract
Request:
GET /check?v[js/app.js]=1.0.2&v[css/style.css]=0.1.0Response example:
{
"js/app.js": { "url": "https://cdn.example.com/releases/js/app.1.0.3.js", "version": "1.0.3" },
"css/style.css": { "url": "https://cdn.example.com/releases/css/style.0.1.1.css", "version": "0.1.1" }
}Return {} if nothing to update.
Notes
- iOS: you must register the
WKURLSchemeHandleror ensure the Cordova WKWebView engine registers the handler for the scheme you use (or use another strategy). See plugin README details in source. - Security: use HTTPS, validate integrity, use atomic writes and keep rollback strategy.
