App Version Update Strategy
Manually target specific app versions for OTA updates instead of using automatic compatibility checks.
Overview
The App Version strategy gives you manual control over which app versions receive updates. You specify exact versions or ranges when deploying, rather than relying on automatic fingerprint detection.
When to use it: Choose this if you prefer explicit version targeting over automated compatibility checks.
Setup
Configure the strategy in your Hot Updater config:
import { defineConfig } from "hot-updater";
export default defineConfig({
updateStrategy: "appVersion",
});Version Targeting
Use version ranges to control which app versions receive updates. The -t option accepts various expressions:
| Range | Who gets the update |
|---|---|
1.2.3 | Only version 1.2.3 |
* | All versions |
1.2.x | Any patch version of 1.2 |
1.2.3 - 1.2.7 | Versions 1.2.3 through 1.2.7 (inclusive) |
>=1.2.3 <1.2.7 | Versions 1.2.3 (inclusive) to 1.2.7 (exclusive) |
1.2 | Same as >=1.2.0 <1.3.0 |
~1.2.3 | Same as >=1.2.3 <1.3.0 |
^1.2.3 | Same as >=1.2.3 <2.0.0 |
Deployment
Specify the target version when deploying:
npx hot-updater deploy -p <"ios" | "android"> -t "1.x.x"Examples:
npx hot-updater deploy -p ios -t "1.0.0"- Only version 1.0.0npx hot-updater deploy -p android -t ">=1.2.0"- Version 1.2.0 and abovenpx hot-updater deploy -p ios -t "*"- All versions
Client Setup
Configure your React Native app:
import { HotUpdater, getUpdateSource } from "@hot-updater/react-native";
import { View, Text } from "react-native";
function App() {
return (
<View>
<Text>Hello World</Text>
</View>
);
}
export default HotUpdater.wrap({
source: getUpdateSource("https://your-update-server.com/api/update-check", {
updateStrategy: "appVersion",
}),
})(App);The client automatically constructs this endpoint:
GET {baseUrl}/app-version/:platform/:appVersion/:channel/:minBundleId/:bundleIdTesting the Endpoint
Test your update endpoint using curl:
curl "https://your-update-endpoint.com/check-update/app-version/ios/1.0.0/production/00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000001"Parameters:
:platform-iosorandroid:appVersion- Current app version (e.g.,1.0.0):channel- Channel name (e.g.,production,staging):minBundleId- Minimum supported bundle ID:bundleId- Current bundle ID
Channels
Channels let you manage updates across different environments (development, staging, production) and target specific user groups or separate applications.
Fingerprint Update Strategy
Automatically prevent incompatible OTA updates by tracking native code changes with Expo's fingerprint library.