-
Notifications
You must be signed in to change notification settings - Fork 467
Different versions available simultaneously #149
Comments
Hi,
Not exactly. You can restrict plugin from downloading web content by using
Usually you would want your users to have the latest version of the app. It's a bit hard to maintain several versions of the web content at the same time. But this is doable via JS API. Let's say you have several app versions: 1.x, 2.x and so on. And you want to provide updates for all of them. Assume, that your server's url is
Basically, each new version will have an In that folder we place {
"content_url": "https://myserver.com/[VERSION]/www/"
} In We finished setting up server. Now lets configure our application. First, in the <chcp>
<auto-install enabled="false" />
<auto-download enabled="false" />
</chcp> You can omit Now in your var app = {
initialize: function() {
this.bindEvents();
},
bindEvents: function() {
document.addEventListener('deviceready', this.onDeviceReady, false);
},
onDeviceReady: function() {
// [VERSION] should be replaced with the version of the app.
// You can either get it from native, or hardcode, since you know which web content is for which app version
var options = {
'config-file': 'https://myserver/com/[VERSION]/chcp.json'
};
chcp.configure(options, app.didConfigureCHCP);
},
didConfigureCHCP: function(error) {
if (error) {
console.log('Failed to set chcp.json url');
return;
}
chcp.fetchUpdate(app.didFetchUpdate);
},
didFetchUpdate: function(error, data) {
if (error && error.code === chcp.error.NOTHING_TO_UPDATE) {
console.log('Nothing new is available for download');
return;
}
if (error) {
console.log('Failed to download update');
return;
}
chcp.installUpdate(app.didInstallUpdate);
},
didInstallUpdate: function(error) {
if (error) {
console.log('Failed to install update');
return;
}
console.log('Update installed');
}
};
app.initialize(); As you can see from JS code - first we set proper Right now you need to use |
Clear and clever, I couldn't ask more. Thank you very much for your explanation! |
👋 Hi! Thank you for your interest in this repo. 😢 We are not using nordnet/cordova-hot-code-push anymore, and we lack the manpower and the experience needed to maintain it. We are aware of the inconveniece that this may cause you. Feel free to use it as is, or create your own fork. 🔒 This will now be closed & locked. ℹ️ Please see #371 for more information. |
Hi!
Thank you for this great plugin! It's magical!
As far as I understood when I deploy a new bundle on S3 it is considered available to all the devices that have the same version in
config.xml
but with a lowerios-CFBundleVersion
isn't it?Is it possible to make different bundles coexist for different versions in order to update, when possible, different app versions?
The text was updated successfully, but these errors were encountered: