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.
8b47da71b3b7cf7fa7fd0ad4938207d01d584430
) representing the current state of your project's native code. It's calculated every time the CLI is run. It changes whenever there are modifications to native dependencies, direct native code edits, or Expo SDK updates.hot-updater deploy
command, hot-updater
compares the stored fingerprint hash. It then ensures that updates are only sent to clients whose native version is compatible with the JavaScript bundle being deployed.hot-updater
builds and deploys a JavaScript bundle, it automatically injects the current project's fingerprint hash into that bundle. The client application uses this injected fingerprint to verify compatibility with its own native code.You can enable this feature by setting the updateStrategy
option to fingerprint
in your hot-updater.config.ts
file. If this option is not explicitly set, fingerprint
is used by default.
The fingerprint configuration also helps determine when builds should be cached and invalidated in non-standard settings, such as when you have git submodules in your project:
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.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.