# Deploy =\> DeployDownloadOptions

**URL:** <https://forum.ionicframework.com/t/deploy-deploydownloadoptions/64881>\
**Category:** ionic-v3\
**Created:** [September 28, 2016, 9:14pm UTC](https://forum.ionicframework.com/t/deploy-deploydownloadoptions/64881 "2016-09-28T21:14:22Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![reich](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/reich/32/90904_2.png) [@reich](https://forum.ionicframework.com/u/reich)\
**Post date:** [September 28, 2016, 9:14pm UTC](https://forum.ionicframework.com/t/deploy-deploydownloadoptions/64881/1 "2016-09-28T21:14:22Z")

</div>

Hi,

I’m tryin to add a progressbar to the download of a new package within the deploy scenario.  
I didn’t get it work :-/

I tried to create a class that implements the interface, but I didn’t get it work to import the DeployDownloadOptions?

My code  
import {Deploy, DeployDownloadOption} from ‘@ionic/cloud-angular’;

> **[Ionic Services Docs](http://legacy-cloud-docs.ionic.io)**
>
> Documentation for the Ionic Services Service: Push, Users, Package, and Deploy

maybe anyone has already done sthg. like this?

thx  
Meex

---

<div class="post-metadata">

**Author:** ![reich](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/reich/32/90904_2.png) [@reich](https://forum.ionicframework.com/u/reich)\
**Post date:** [October 2, 2016, 7:29pm UTC](https://forum.ionicframework.com/t/deploy-deploydownloadoptions/64881/2 "2016-10-02T19:29:15Z")

</div>

No one out there, who can help me ☹

---

<div class="post-metadata">

**Author:** ![dmastag](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/dmastag/32/104373_2.png) [@dmastag](https://forum.ionicframework.com/u/dmastag)\
**Post date:** [December 9, 2016, 9:22am UTC](https://forum.ionicframework.com/t/deploy-deploydownloadoptions/64881/3 "2016-12-09T09:22:38Z")

</div>

Did you find this eventually?

Your link actually brought me into the right track to implement what I needed, so to give back here is the code I used :

```auto
this.deploy
   .download({
      onProgress: p => console.log('progress at ' + p + '%')
   })

```

Hope that helps!

---

<div class="post-metadata">

**Author:** ![dmastag](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/dmastag/32/104373_2.png) [@dmastag](https://forum.ionicframework.com/u/dmastag)\
**Post date:** [December 9, 2016, 11:17am UTC](https://forum.ionicframework.com/t/deploy-deploydownloadoptions/64881/4 "2016-12-09T11:17:54Z")

</div>

In case someone could use my full code

```auto
this.deploy.check().then((snapshotAvailable: boolean) => {
    if (snapshotAvailable) {

        let alert = this.alertCtrl.create({
            title: 'There is an update to Awesome App',
            message: 'Do you want to update?',
            buttons: [{
                text: 'Cancel',
                handler: () => {
                    console.log('Cancel clicked');
                }
            }, {
                text: 'Update',
                handler: () => {

                    let updateMe = true;

                    let toast = this.toastCtrl.create({
                        message: 'Downloading .. 0%',
                        position: 'bottom',
                        showCloseButton: true,
                        closeButtonText: 'Cancel'
                    });

                    toast.onDidDismiss(() => {
                        updateMe = false;
                    });

                    toast.present();

                    // this.deploy.channel = 'production';
                    this.deploy
                        .download({
                            onProgress: p => {
                                toast.setMessage('Downloading .. ' + p + '%');
                                console.log('Downloading = ' + p + '%');
                            }
                        })
                        .then(() => {

                            if (updateMe) {
                                this.deploy
                                    .extract({
                                        onProgress: p => {
                                            toast.setMessage('Extracting .. ' + p + '%');
                                            console.log('Extracting = ' + p + '%');
                                        }
                                    })
                                    .then(() => {
                                        if (updateMe) {
                                            return this.deploy.load();
                                        }
                                    })
                                    .catch(() => toast.setMessage('Uhh ohh, network problem!'))
                            }

                        })
                        .catch(() => toast.setMessage('Uhh ohh, network problem!'))
                }
            }]
        });
        alert.present();
        // When snapshotAvailable is true, you can apply the snapshot

    }
});

```

Basically its

Check for Update --\> Alert User --\> Call Toast --\> Download (update Toast with Download %) --\> Extract (update Toast with Extract %) --\> Load

Also a catch in case the connection breaks (Believe me, it happens!)

---

<div class="post-metadata">

**Author:** ![meatrobot](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/meatrobot/32/105217_2.png) [@meatrobot](https://forum.ionicframework.com/u/meatrobot)\
**Post date:** [February 9, 2017, 1:50am UTC](https://forum.ionicframework.com/t/deploy-deploydownloadoptions/64881/5 "2017-02-09T01:50:23Z")

</div>

Thanks for this @dmastag - really helpful. It seems to be downloading/extracting/restarting OK, but I don’t see the changes I made in the latest snapshot showing up. Not sure if there’s something I’m missing.

---

<div class="post-metadata">

**Author:** ![dmastag](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/dmastag/32/104373_2.png) [@dmastag](https://forum.ionicframework.com/u/dmastag)\
**Post date:** [February 9, 2017, 2:50am UTC](https://forum.ionicframework.com/t/deploy-deploydownloadoptions/64881/6 "2017-02-09T02:50:06Z")

</div>

Not sure, is the correct channel setup in [ionic.io](http://ionic.io) ?

---

<div class="post-metadata">

**Author:** ![meatrobot](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/meatrobot/32/105217_2.png) [@meatrobot](https://forum.ionicframework.com/u/meatrobot)\
**Post date:** [February 9, 2017, 4:21am UTC](https://forum.ionicframework.com/t/deploy-deploydownloadoptions/64881/7 "2017-02-09T04:21:53Z")

</div>

Yeah. Turns out that I need to run “ionic build --prod” before uploading my snapshot. Since the app running on the device is built w/ aot I think the snapshot needs to match that or things get weird.

---

<div class="post-metadata">

**Author:** ![meatrobot](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/meatrobot/32/105217_2.png) [@meatrobot](https://forum.ionicframework.com/u/meatrobot)\
**Post date:** [February 9, 2017, 4:30am UTC](https://forum.ionicframework.com/t/deploy-deploydownloadoptions/64881/8 "2017-02-09T04:30:56Z")

</div>

Also beware getting your app rejected by Apple if you have a prompt: [Ionic Deploy iOS Apple App Store Rejection](https://forum.ionicframework.com/t/ionic-deploy-ios-apple-app-store-rejection/77971/3)

---

<div class="post-metadata">

**Author:** ![dmastag](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/dmastag/32/104373_2.png) [@dmastag](https://forum.ionicframework.com/u/dmastag)\
**Post date:** [February 9, 2017, 4:34am UTC](https://forum.ionicframework.com/t/deploy-deploydownloadoptions/64881/9 "2017-02-09T04:34:54Z")

</div>

Haha, yeah got that also.

---

<div class="post-metadata">

**Author:** ![nylex](https://avatars.discourse-cdn.com/v4/letter/n/7ab992/32.png) [@nylex](https://forum.ionicframework.com/u/nylex)\
**Post date:** [February 27, 2017, 6:56am UTC](https://forum.ionicframework.com/t/deploy-deploydownloadoptions/64881/10 "2017-02-27T06:56:12Z")

</div>

Does deploy upload the AOT version of JS? I see the app got slow after deployed a new build.
