How to use the @ionic-native/code-push.InstallMode.IMMEDIATE function in @ionic-native/code-push

To help you get started, we’ve selected a few @ionic-native/code-push examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github adrianonrails / baruch / src / providers / app-update-service.ts View on Github external
notificationObject.text = `Downloaded ${received} of ${total}`;
      notificationObject["progressBar"] = { value: Math.ceil((progress.receivedBytes / progress.totalBytes) * 100) };
      this.localNotifications.update(notificationObject);
    };

    this.codePush
      .sync({
        updateDialog: {
          updateTitle: "An update is available",
          optionalUpdateMessage: "Change log:\n\n",
          optionalIgnoreButtonLabel: "Not now",
          optionalInstallButtonLabel: "Install",
          appendReleaseDescription: true,
          descriptionPrefix: ""
        },
        installMode: InstallMode.IMMEDIATE
      }, downloadProgress)
      .catch((err) => {
        return [];
      })
      .subscribe((syncStatus) => {
        switch (syncStatus) {
          case SyncStatus.CHECKING_FOR_UPDATE:
            notificationObject.text = "Checking for updates..."
            this.localNotifications.schedule(notificationObject);
            break;
          case SyncStatus.INSTALLING_UPDATE:
            notificationObject.text = "Installing update...";
            notificationObject["progressBar"] = { value: 100 };
            this.localNotifications.update(notificationObject);
            break;
          case SyncStatus.UP_TO_DATE: