React Native · APIs and utilities
Store updates
In-app update.
7 exports
Import
AppUpdate
moduleIn-app update.
- Android (Google Play In-App Updates):
immediateis Play's fullscreen flow (downloads, installs, restarts the app);flexibledownloads in the background, thenAppUpdate.completeinstalls and restarts. Works only in apps installed from the Play Store (for testing, use an internal test track in the Play Console). - iOS: Apple does not allow installing from inside the app.
AppUpdate.checkqueries the version on the App Store;AppUpdate.startopens the App Store page inside the app (the user taps "Update"). App Store version info may lag a few hours after release.
| Name | Type | Description |
|---|---|---|
check | (options?: { country?: string; }) => Promise<AppUpdateInfo> | Is there an update. iOS: country is the App Store country (default: the device's). |
start | (options?: { type?: "immediate" | "flexible"; }) => Promise<AppUpdateResult> | Starts the update. Android: immediate (default) or flexible. iOS always opens the App Store page. accepted if the user accepted, dismissed if they declined. |
complete | () => Promise<void> | Android flexible: installs the downloaded update (the app restarts). |
openStore | () => Promise<void> | Opens the store page (inside the app on iOS). |
addProgressListener | (listener: (progress: AppUpdateProgress) => void) => () => void | Android flexible download progress. |
useAppUpdate
functionChecks for an update on mount (and with checkOnMount); tracks flexible download progress.
Examples
AppUpdateInfo
interfaceUpdate info.
| Name | Type | Description |
|---|---|---|
available | boolean | A newer version is available in the store. |
inProgress | boolean | Android: a started update is in progress (e.g. an immediate one was interrupted). |
currentVersion | string | null | Installed version. |
storeVersion | string | null | iOS: version on the App Store. Android Play does not provide it (null). |
versionCode | number | null | Android: version code in the store. |
stalenessDays | number | null | How many days the update has been waiting (Android Play; on iOS since the release date). |
priority | number | null | Android: priority set in the Play Console (0–5). |
immediateAllowed | boolean | Fullscreen update available (iOS: App Store page). |
flexibleAllowed | boolean | Android: background download available. |
installStatus | AppUpdateStatus | Android: status of the ongoing download/install. |
storeUrl | string | null | Store page. |
releaseNotes | string | null | iOS: "What's New" text. |
AppUpdateStatus
typeDownload/install status (Android flexible).
AppUpdateProgress
interfaceDownload progress (Android flexible).
| Name | Type | Description |
|---|---|---|
status | AppUpdateStatus | Current phase of the update. |
loaded | number | Bytes downloaded so far. |
total | number | Total bytes to download (0 if unknown). |
error | number | null | Error code (Play InstallErrorCode). |
AppUpdateResult
typeResult of starting the update.
UseAppUpdateResult
interfaceResult of useAppUpdate.
| Name | Type | Description |
|---|---|---|
info | AppUpdateInfo | null | Last check (null if not checked). |
progress | AppUpdateProgress | null | Android flexible progress. |
error | Error | null | Check error (no Play Store, network…). |
check | (): Promise<AppUpdateInfo | null> | Checks again. |
start | (type?: "immediate" | "flexible"): Promise<AppUpdateResult | null> | Starts the update. |
complete | (): Promise<void> | Installs the downloaded update (Android flexible). |