HotUpdater.updateBundle()The updateBundle function downloads and applies a new update bundle to your React Native application. It uses the provided bundle information obtained from checkForUpdate.
This method is particularly useful when you need a custom update strategy without using the built-in wrap method.
Use updateBundle to download and apply an available update by providing the bundle's unique identifier and the URL to the bundle file.
getUpdateSourceThe getUpdateSource function is used to construct the final URL for checking for updates. It takes a baseUrl as its first argument and an options object as its second argument. The updateStrategy property within the options object determines the final structure of the request URL.
Example Final Endpoint Structures:
Depending on the updateStrategy value, getUpdateSource generates URLs like the following:
updateStrategy: 'appVersion': GET {baseUrl}/app-version/:platform/:appVersion/:channel/:minBundleId/:bundleIdupdateStrategy: 'fingerprint': GET {baseUrl}/fingerprint/:platform/:fingerprintHash/:channel/:minBundleId/:bundleIdFor example, if you provide https://your-update-server.com/api/update-check as the baseUrl, getUpdateSource will append the correct path and parameters to the URL depending on whether updateStrategy is 'appVersion' or 'fingerprint'.
The updateBundle function accepts the following parameters:
| Parameter | Type | Required | Description | 
|---|---|---|---|
id | string | ✅ | Unique identifier of the update bundle. | 
fileUrl | string | ✅ | URL from which the update bundle will be downloaded. | 
fileHash | string | null | ⚠️ Optional but recommended | SHA256 hash of the bundle file for integrity verification. If provided, the downloaded file will be verified before extraction. | 
fileUrl.fileHash is provided: Verifies the downloaded file's SHA256 hash before extraction. If verification fails, the update is aborted and the downloaded file is deleted.fileHash is not provided: Proceeds with extraction without hash verification (not recommended for production).HotUpdater.reload() if you want to immediately reload the application after updating, particularly when shouldForceUpdate is true.Always provide fileHash in production environments. Hash verification protects against:
Use updateInfo.updateBundle() instead of HotUpdater.updateBundle() whenever possible. The updateInfo.updateBundle() method automatically includes the fileHash from the checkForUpdate() response, ensuring secure verification without manual parameter passing.
The fileHash is automatically included in the response from checkForUpdate() when your update server provides it.