The "Fingerprint" update strategy in hot-updater
leverages Expo's @expo/fingerprint
library to track and manage changes in your project's native code. This mechanism significantly enhances the stability of app updates by preventing the delivery of JavaScript bundles incompatible with the native code.
The Fingerprint strategy ensures OTA update compatibility by preventing incompatible JavaScript bundles from being delivered to your users. It automatically detects when native code changes would break compatibility and blocks unsafe OTA deployments.
Choose Fingerprint if you want automatic protection against incompatible updates. Choose App Version if you prefer manual control over update targeting.
Result: Fingerprint stays the same → OTA update deployed safely
Result: Fingerprint changes → OTA deployment blocked → Native rebuild needed
When you try to deploy an OTA update but the fingerprint has changed:
Before building your app for the App Store, always generate the fingerprint:
This command:
ios/YourApp/Info.plist
with the fingerprintandroid/app/src/main/res/values/strings.xml
with the fingerprintNow build your native app with the embedded fingerprint and submit to App Store.
After your app is live, you can deploy JavaScript-only updates:
The system automatically ensures only compatible updates reach your users.
Fingerprint is the default strategy, but you can explicitly set it:
If you have extra files that affect native compatibility:
getUpdateSource
When using the fingerprint strategy in your React Native application, you need to configure the getUpdateSource
function with the updateStrategy
set to "fingerprint"
. This ensures that the client app sends the correct fingerprint hash when checking for updates.
The getUpdateSource
function will automatically construct the correct endpoint URL for the fingerprint strategy:
GET {baseUrl}/fingerprint/:platform/:fingerprintHash/:channel/:minBundleId/:bundleId
It's crucial to check and, if necessary, update the fingerprint whenever changes are made to the native code.
Check Current Fingerprint:
This command calculates the current project's fingerprint and shows whether it matches the stored value.
Create a New Fingerprint: If the command above indicates a mismatch, you must generate a new fingerprint using:
Important: After creating a new fingerprint, you must rebuild your app. This ensures that the updated native environment and the new fingerprint are correctly incorporated into the app binary, preventing compatibility issues with apps built using the previous fingerprint.
fingerprint create
Does AutomaticallyWhen you run pnpm hot-updater fingerprint create
, it automatically:
ios/YourApp/Info.plist
android/app/src/main/res/values/strings.xml
Only configure additional paths if you have:
💡 Most projects don't need this configuration - the default behavior handles standard React Native projects perfectly.
fingerprint.json
)You can test if the update check endpoint, configured via the hot-updater init
command, is working correctly. When using the fingerprint
strategy, the endpoint format is typically:
GET /check-update/fingerprint/:platform/:fingerprintHash/:channel/:minBundleId/:bundleId
Example of testing with curl
:
Request Parameter Descriptions:
:platform
: The platform, such as ios
or android
.:fingerprintHash
: The current fingerprint hash of the client app.:channel
: The channel name you want to check for updates (e.g., default
, staging
).:minBundleId
: The minimum bundle ID supported by the client (this value is updated when the native app is rebuilt. If unknown for testing, you can use 00000000-0000-0000-0000-000000000000
).:bundleId
: The client's current bundle ID.This request allows you to verify if an update is available for a specific fingerprint hash and channel.