Skip to main content

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.

Flexible updates let your app download a new version silently in the background while the user continues to interact with the app normally. Once the download completes, the library automatically triggers installation — no manual call to completeUpdate() is needed on your end. This makes flexible updates ideal for non-critical releases where you want a seamless, low-friction upgrade experience.

When to use Flexible updates

Use UpdateFlow.FLEXIBLE when:
  • The update contains feature additions or minor improvements that aren’t urgent.
  • Interrupting the user would hurt the experience (e.g. mid-session or mid-transaction).
  • You want to silently keep users on the latest version without them noticing.
For security patches or breaking API changes, prefer Immediate updates instead.

How the Flexible update flow works

1

Check for an available update

Call checkForUpdate(UpdateFlow.FLEXIBLE). The library queries the Play Store and returns immediately once the update flow has started (or confirms no update is available).
2

User accepts the update

Google Play shows a non-blocking prompt asking the user to start the download. The user can dismiss it and continue using the app.
3

Download runs in the background

The update downloads silently while the user stays in the app. Progress is managed entirely by the Play Core library.
4

Installation triggers automatically

The native module registers an install-state listener. When InstallStatus.DOWNLOADED fires, it calls appUpdateManager.completeUpdate() automatically — you do not need to call anything extra.

Promise resolution values

Resolved valueMeaning
"No update available"Play Store reports the app is already up to date.
"Flexible update started"The update flow was launched successfully and the download will proceed in the background.
The Promise resolves as soon as the flow starts — it does not wait for the download to finish. Handle the rejection cases using a try/catch block or .catch(). See Error Handling for all possible rejection codes.

Full code example

import { checkForUpdate, UpdateFlow } from 'react-native-in-app-updates';

async function triggerFlexibleUpdate() {
  try {
    const result = await checkForUpdate(UpdateFlow.FLEXIBLE);

    if (result === 'No update available') {
      console.log('App is already up to date.');
      return;
    }

    // result === 'Flexible update started'
    // The download is now running in the background.
    // The library will call completeUpdate() automatically
    // once InstallStatus.DOWNLOADED is detected.
    console.log('Update is downloading in the background.');
  } catch (error: any) {
    console.error('Update check failed:', error.message);
    // See /guides/error-handling for error codes
  }
}

Auto-completion behaviour

You do not need to call completeUpdate() yourself. The Kotlin native module registers a listener via appUpdateManager.registerListener when the flexible flow starts. When the install state transitions to InstallStatus.DOWNLOADED, the module calls appUpdateManager.completeUpdate() automatically. The app will then restart and apply the new version.
// From InAppUpdatesModule.kt — this happens inside the library, not your code
appUpdateManager.registerListener { state ->
    if (state.installStatus() == InstallStatus.DOWNLOADED) {
        appUpdateManager.completeUpdate()
    }
}
Consider showing a brief toast or snackbar (e.g. “Update downloaded — restarting…”) when you know an update has started. Because the Promise resolves with "Flexible update started" right away, you can display a subtle in-app notification at that point to set user expectations before the automatic restart occurs.

Error handling

Wrap every checkForUpdate call in a try/catch. The most common errors for flexible updates are:
  • NOT_ALLOWED — the Play Store does not permit a flexible update for this particular version bump (e.g. the server side forces an immediate update). Fall back to UpdateFlow.IMMEDIATE if needed.
  • UPDATE_CHECK_FAILED — a network or Play Store error prevented the availability check.
See the full list of error codes and recommended actions in the Error Handling guide.

Build docs developers (and LLMs) love