willb
November 23, 2015, 10:02am
1
Has anybody used Ionic Deploy successfully with an Ionic 2 app?
I have two problems:
The UI doesn’t update after interacting with Ionic.Deploy(). In Angular 1 terms, it looks like $digest is not triggered. Only when I click the screen somewhere it updates.
The apps UI overlaps with the iOS statusbar after updating (https://github.com/driftyco/ionic-plugin-deploy/issues/48 )
willb
November 23, 2015, 10:29am
2
Update: To refresh the UI, this works:
import {NgZone} from 'angular2/angular2';
constructor() {
this.zone = new NgZone({enableLongStackTrace: false});
}
this.deploy.check().then(hasUpdate => {
this.zone.run(() => {
this.hasUpdate = hasUpdate;
});
}
See: http://stackoverflow.com/questions/31706948/angular2-view-not-changing-after-data-is-updated
Would this be an temporary consequence of Angular2’s view-rendering logic?
hi.
how do you implement ionicDeploy for ionic 2 ?
Finally i implemented update using npm ionic-plugin-update
IonicDeploy.init(this.app_id, 'https://api.ionic.io');
IonicDeploy.check(this.app_id, 'dev', function(result) {
if (result && result === "true") {
console.log('an update is available');
IonicDeploy.download(this.app_id, function(result) {
if (result !== 'true' && result !== 'false') {
console.log('progress')
} else {
if (result === 'true') {
console.log('Download completed');
// Load the updated version
IonicDeploy.extract(this.app_id, function(result) {
if (result !== 'done') {
console.log('extracting progress')
} else {
console.log(result);
if (result === 'true') {
console.info("extraction complete");
}
IonicDeploy.redirect(this.app_id);
}
}, function(error) {
console.error(error);
});
}
}
}, function(error) {
console.error(error);
});
} else {
console.log('no updates available');
}
}, function(error) {
console.log(error)
});
and after redirect my app is updated but all plugins was broken and after restart app loaded old version
how do you implement ionic deploy in ionic 2 sir?tnx in advance.