Hi,
I am using Ionic Cloud to build my packages in PROD mode. I noticed that for every cloud package I build with this command: ionic package build android --prod --release --profile prod
It ALSO puts a Deploy Snapshot into Ionic Deploy.
This means, that as soon as user downloads the app from the AppStore, it prompts them that there is a new version and downloads a DEV version of the build and downgrades them. The Dev version is NOT AOT/minified and uses the Dev variables (e.g. localhost) so it renders the app unusable.
My deployment service code is set to only look in the production channel (and a toast message confirms that this is the channel it is watching) - however it finds Dev channel snapshots and deploys them.
For now I have had to remove this functinoality from my app and do APK upgrades. Browsing the forum, it seems like quite a common problem.
Cordova CLI: 6.5.0
Ionic Framework Version: 2.3.0
Ionic CLI Version: 2.2.2
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.2.5
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v6.10.0
Xcode version: Not installed
and the code:
channel:", this.deploy.channel);
}
public isNewVersionAvailable(): Promise<boolean> {
this.loggerService.info("DeployService - isNewVersionAvailable");
if (this.platform.is('cordova')) {
this.toastService.show("Canal: " + this.deploy.channel);
return this.deploy.check();
}
else {
this.toastService.show("DeployService: Running on web - cannot check for new versions...");
return Promise.resolve(false);
}
}
public checkForNewVersionUpdateAndAsk(): void {
this.loggerService.info("checkForNewVersionUpdateAndAsk");
if (this.platform.is('cordova')) {
this.deploy.check()
.then((snapshotAvailable: boolean) => {
if (snapshotAvailable) {
this.showUpdateAlert();
}
})
.catch(() => {
//TODO: What to do here? Should we alert a service?
this.loggerService.error("Error: Could not check for new versions - please try again or contact Support");
this.toastService.showAndClose("Error: No fue posible buscar nuevas versiones - Por favor inténtalo más tarde o contacta a soporte");
});
}
else {
this.toastService.show("DeployService: Running on web - cannot check for new versions...");
}
}
public downloadAndInstall(): any {
if (this.platform.is('cordova')) {
this.loggerService.error("downloadAndInstall");
this.toastService.show("Descargando...");
this.deploy.download()
.then(() => {
this.toastService.show("Extrayendo...");
this.deploy.extract()
.then(() => {
this.toastService.show("Reiniciando...");
this.deploy.load();
})
})
.catch(() => {
this.loggerService.error("Error: No es posible iniciar la descarga - please try again or contact Support");
this.toastService.showAndClose("Error: No es posible iniciar la descarga - Por favor inténtalo más tarde o contacta a soporte");
});
}
else {
this.toastService.show("DeployService: Running on web - cannot download...");
}
}