How to use Ionic Cloud Deploy on Ionic 2

The docs is very unclear. I want to know where should I put the code:

this.deploy.check().then((snapshotAvailable: boolean) => {
this.deploy.download().then(() => {
return this.deploy.extract().then( () => {
this.deploy.load();
console.log(‘Extract Succesful’);
};
});
});

So I want just like the old behavior on Ionic 1. I can put the code in app.ts and it watch everything (all the pages and all the provides) and detect if any changes and do an auto update on client devices. But the doc said I need to inject import {Deploy} from ‘@ionic/cloud-angular’ in EACH PAGE? This really confuses me. How can I just put 1 code in 1 place and watch everything. A kinda set it and forget about it solution like Ionic 1…

Please help!

1 Like

Hi @Hughred22,
any progress with this? I’m really confused too.

If you success with your purpose, please, share your code. :+1:

Thanks!

The best place would be the web worker. Im thinking to move it there but for now i am using in app component with a set timeout to run only once on app start.

When i force app to deploy fresh uploaded for deployment version to production channel, it after reload run downgraded version… When trying use “dev” channel, it not download version to deploy.

Yes, I have noticed the same behaviour - Dev channel builds are deployed over production builds - Ionic Cloud Deploy Service always downgrades Production to old Dev Version Did you find an answer to this?