Use the following method to download and install the latest version of your app in a single step:

UpdateController.Instance.InstallUpdate()

This method initiates both the download and installation in one continuous flow, eliminating the need to call separate functions.

Note: The player may be prompted to grant permission the first time this method is used. This prompt appears only once. Future updates will not require additional approval. Depending on the device manufacturer and model, additional popups may appear during the installation process.

Installation process and callbacks

Once permission is granted, the following callbacks occur in sequence:

  1. OnDownloadStarted: Triggered when the download of the new app version begins.
  2. OnProgress: Triggered continuously as new data is downloaded.
  3. OnDownloadEnded: Triggered when the download is complete.
  4. OnInstallationReady: Triggered when the file is ready to install.

Error handling

The following errors may occur during installation:

  • If the player cancels or interrupts the installation, the OnError callback is triggered with the relevant error code.
  • If the player declines the installation permission, OnError callback is triggered with the error code 3000.

For more details on error codes and solutions, review the Unity Auto Update SDK troubleshooting article.