0

I use the auto update method to update the app using an ionic pro, The problem is when there is a slow internet connection, The app takes more time to update the app, The splash screen is shown a long time.

Users think that there is a problem in the app and it hangs at the splash screen.

Is there any way to so show a message while updating the app at splash screen? At least the user will know that the app is being updated.

<plugin name="cordova-plugin-ionic" spec="5.3.0">
        <variable name="APP_ID" value="xxxxxx" />
        <variable name="CHANNEL_NAME" value="Production" />
        <variable name="UPDATE_METHOD" value="auto" />
        <variable name="UPDATE_API" value="https://api.ionicjs.com" />
        <variable name="MAX_STORE" value="2" />
        <variable name="MIN_BACKGROUND_DURATION" value="30" />
</plugin>
Anshul Riyal
  • 123
  • 1
  • 12

1 Answers1

0

I don't think it is possible to show updating on splash screen. but it is possible to show updating processing. here is full code for you.

Pro.deploy.checkForUpdate().then((update) => {
      console.log(update);
      if (typeof update !== 'undefined') {
        if (update.available) {
          let alert = self.alertCtrl.create({
            title: 'Update Available',
            message: 'There is an update available. Would you like to get it?',
            buttons: [
              {
                text: 'Cancel',
                role: 'cancel'
              },
              {
                text: 'Ok',
                handler: () => {
                  this.performManualUpdate();
                }
              }
            ]
          });
          alert.present();

        }
      }
    });

async performManualUpdate() {
    try {
        let loader = this.loadingCtrl.create({
          content: "Updating...",
        });
        loader.present();

      await Pro.deploy.downloadUpdate((progress) => {
        this.downloadProgress = progress;
      })
      await Pro.deploy.extractUpdate();
      await Pro.deploy.reloadApp();
      loader.dismiss();

    } catch (err) {
      console.log(err);
    }
  }
BestMob
  • 91
  • 3