How can I implement 'update interface' when a new app version is released based on Unity3D?
I have received this message from AppGallery review team : "We found that the detection updating interface isn't called in HMS after the app's startup".
The only documents that I have found is for implementing in Android studio in this link : Updating an App
After an app is launched or when a user proactively checks whether there is a later version, call the related API of the HMS Core SDK to check whether there is a later version available on AppGallery. If so, display a pop-up asking the user whether to update the app.
The key steps for achieving this function are as follows:
A user triggers an update check, for example, by launching the app or manually performing the check on the update check page.
The app calls
JosApps.getAppUpdateClientto request to initialize theAppUpdateClientinstance.AppUpdateClient client = JosApps.getAppUpdateClient(this);The HMS Core SDK returns the
AppUpdateClientinstance of the current app to the app.The app calls the
AppUpdateClient.checkAppUpdatemethod to request an update check.The HMS Core SDK queries the latest app version information on AppGallery.
AppGallery sends the app version information back to the HMS Core SDK.
The HMS Core SDK sends the check result to the app through a callback.
The app checks the
ApkUpgradeInfoinstance returned by theonUpdateInfomethod in the callback result and checks whether an update is available.AppUpdateClient.showUpdateDialogmethod to request to display the update pop-up for the user.The HMS Core SDK displays the update pop-up for the user.
The user chooses to update the app on the update confirmation page.
The HMS Core SDK sends a request to AppGallery to download the latest app installation package.
AppGallery returns the app package to the HMS Core SDK. The HMS Core SDK starts to install the app after the download is complete.
For more details, pls kindly check this docs.