Documentation Index
Fetch the complete documentation index at: https://mintlify.com/aravind3566/react-native-in-app-updates/llms.txt
Use this file to discover all available pages before exploring further.
checkForUpdate returns a Promise that either resolves with a success string or rejects with an Error object. Errors originate from two layers: the TypeScript module (platform and argument validation) and the Kotlin native module (Play Core API responses). This guide documents every possible rejection and the best way to handle it.
Success values are not errors
Before diving into errors, note that"No update available" is a resolved value — it means checkForUpdate succeeded and the Play Store confirmed the app is already current. Never treat it as an error condition.
Recommended try/catch pattern
Always wrapcheckForUpdate in a try/catch and inspect error.code for programmatic branching. The code property maps to the string codes listed in this guide.
Error reference
"This library is only available on Android."
"This library is only available on Android."
Origin: TypeScript layer (This library is Android-only by design — Google Play In-App Updates is not available on iOS.
src/index.tsx)When it occurs: checkForUpdate was called on iOS, web, or any non-Android platform. The rejection happens synchronously before the native module is ever touched.error.code: undefined (standard Error, no .code property set)Recommended action: Guard all checkForUpdate calls with a platform check:"Invalid update flow. Use UpdateFlow.IMMEDIATE or UpdateFlow.FLEXIBLE."
"Invalid update flow. Use UpdateFlow.IMMEDIATE or UpdateFlow.FLEXIBLE."
Origin: TypeScript layer (TypeScript’s type system will catch this at compile time if
src/index.tsx)When it occurs: A string or value other than UpdateFlow.IMMEDIATE or UpdateFlow.FLEXIBLE was passed as the first argument.error.code: undefined (standard Error, no .code property set)Recommended action: Always use the exported UpdateFlow enum rather than raw strings:UpdateFlow is used correctly."NO_ACTIVITY" / "No current activity"
"NO_ACTIVITY" / "No current activity"
Origin: Kotlin native module (
InAppUpdatesModule.kt)error.code: "NO_ACTIVITY"When it occurs: The native module attempted to start the update flow but reactApplicationContext.currentActivity returned null. This typically happens when:checkForUpdateis called before the root Activity has fully mounted.- The app is in the background or in the middle of an Activity transition.
- The device is in a split-screen or PiP mode edge case.
AppState to trigger the check on 'active' is the most reliable approach:"UPDATE_CANCELLED" / "User cancelled the update"
"UPDATE_CANCELLED" / "User cancelled the update"
Origin: Kotlin native module — This rejection is never thrown by
onActivityResult callbackerror.code: "UPDATE_CANCELLED"When it occurs: Only relevant for UpdateFlow.IMMEDIATE. The onActivityResult callback fired with a result code other than RESULT_OK, meaning the user dismissed the full-screen update dialog. This is rare — on most devices the immediate update overlay cannot be dismissed — but it is device-dependent and must be handled.Recommended action: Re-trigger the update check the next time the app comes to the foreground. Do not silently swallow this error for critical updates.UpdateFlow.FLEXIBLE — flexible update acceptance is handled by the install-state listener, not onActivityResult."NOT_ALLOWED"
"NOT_ALLOWED"
Origin: Kotlin native module —
startFlexibleUpdate / startImmediateUpdateerror.code: "NOT_ALLOWED"When it occurs: appUpdateInfo.isUpdateTypeAllowed(AppUpdateType.FLEXIBLE) or isUpdateTypeAllowed(AppUpdateType.IMMEDIATE) returned false. The Play Store server can restrict which update type is permitted for a given update. For example, Google Play can force an immediate update server-side for a release marked as high-priority, making FLEXIBLE unavailable.Recommended action: Fall back to the other update flow type:"UPDATE_CHECK_FAILED"
"UPDATE_CHECK_FAILED"
Origin: Kotlin native module —
addOnFailureListener on the appUpdateInfo taskerror.code: "UPDATE_CHECK_FAILED"When it occurs: The Play Core API call to fetch appUpdateInfo failed. Common causes include:- No internet connection at the time of the check.
- Google Play Store app not installed or not signed in.
- Play Core library version mismatch.
- Play Store servers returned an error.
error.message: Contains e.localizedMessage from the underlying Play Core exception — useful for logging.Recommended action: Treat this as a soft failure. Do not block the user — simply log the error and retry later:Quick reference table
error.code | Origin | Flow | Suggested action |
|---|---|---|---|
| (none) | TypeScript | Both | Use UpdateFlow enum; add Platform.OS === 'android' guard |
| (none) | TypeScript | Both | Pass valid UpdateFlow enum value |
NO_ACTIVITY | Kotlin | Both | Retry after app is foregrounded and Activity is available |
UPDATE_CANCELLED | Kotlin | Immediate only | Retry on next foreground via AppState listener |
NOT_ALLOWED | Kotlin | Both | Fall back to the other UpdateFlow type |
UPDATE_CHECK_FAILED | Kotlin | Both | Log silently; retry on next launch or when network is available |
Related guides
- Flexible Update — background download flow and when to use it
- Immediate Update — blocking full-screen update flow
- Mock Testing — simulate update flows offline during development