To elaborate, here is my live update code. After downloading updates, the user is prompted “we have made improvements to the app. Click ok to update”. The user clicks it, the code calls the following line this.deploy.load(); This causes the app to white screen for 3 seconds and then the app comes back and the live update is complete. The bottomline is that the whole thing works great. But the 3 second white screen while the app loads is extremely unintuitive and a bad user experience.
checkforLiveUpdates() {
this.deploy.check().then((snapshotAvailable: boolean) => {
//Live update is available. Download the update.
if (snapshotAvailable) {
console.log('Snapshot available...');
this.deploy.getMetadata().then((metadata) => {
console.log('New Update Availble', metadata.message ? metadata.message : "");
});
var loadingPopup = this.loadingCtrl.create({
content: 'Downloading Updates...'
});
loadingPopup.present();
this.deploy.download().then(() => {
return this.deploy.extract().then(() => {
loadingPopup.dismiss();
let alert = this.alertCtrl.create({
title: 'New update available',
subTitle: 'We have made improvements to our app. Please press ok to get the latest update.',
buttons: [{
text: 'Ok',
handler: () => {
this.deploy.load();
}
}]
});
alert.present();
}, (error) => {
console.log("Error extracting: " + error);
});
}, (err) => {
loadingPopup.dismiss();
console.log("Error downloading: " + err);
});
}
else {
console.log('No live updates available.');
}
}, (err) => {
console.log("Error Checking for live updates: " + err);
});
}