Hi, I’ve got a problem with the live deploy’s feature. When I upload a new version via git, there are times that, when downloaded from the app, it’s like i lose all the live deploy’s updates and I’m back into the store version.
Versions:
Ionic: 4.3.1
Cordova CLI: 8.0.0
ionic-plugin-cordova: 6.1.0
Node: v8.11.1
Everytime I run:
git add .
git commit -m "test"
git push ionic production
And, after downloading the update like this…
checkUpdates() {
if (!this.platform.is('core') && !this.updateWindow && window != undefined && window.IonicCordova != undefined && window.IonicCordova.deploy != undefined) {
// Initialize the deploy plugin (OPTIONAL)
window.IonicCordova.deploy.init(this.configDeploy, (res: any) => {
console.log(res)
}, (err: any) => {
console.log(err);
})
// Check for available updates
window.IonicCordova.deploy.check((res: any) => {
if (res === 'true') {
// A new version is ready to download
this.alertService.showConfirm("Hay una actualización disponible. ¿Desea actualizar la aplicación?", "Actualización disponible")
.then((resp) => {
if (resp == 'yes') {
let toast = this.toastCtrl.create({
message: 'Descargando...',
position: 'bottom',
showCloseButton: false,
dismissOnPageChange: true
});
toast.present();
window.IonicCordova.deploy.download((res: any) => {
if (res === 'true') {
// We can unzip the latest version
window.IonicCordova.deploy.extract((res: any) => {
if (res === 'true' || (this.utils.isNumber(res) && res == 1)) {
this.alertService.hideLoading();
// we are ready to load the new version
window.IonicCordova.deploy.redirect(() => {
this.nav.setRoot(LoginPage);
}, (e: any) => {
toast.setMessage('Error al instalar la actualización')
})
}
}, (e: any) => {toast.setMessage('Error al instalar la actualización')})
}
}, (e: any) => {toast.setMessage('Error al descargar la actualización')});
}
});
}
}, (e: any) => {
this.alertService.showToast("Error al comprobar nuevas versiones.");
})
}
}
… there are times that my app is back into the store version… And I don’t know why.
Any thoughts are welcome. Thank you very much!