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.

Immediate updates present a full-screen UI managed by Google Play that blocks all interaction with your app until the update is downloaded and installed. The app restarts automatically once the process completes. Because the update is mandatory from the user’s perspective, this flow is best reserved for situations where running an outdated version would cause real harm — such as a critical security patch, a broken API contract, or a mandatory data-migration build.

When to use Immediate updates

Use UpdateFlow.IMMEDIATE when:
  • A security vulnerability has been patched and running the old version poses a risk.
  • A breaking backend API change makes the current version non-functional.
  • A critical bug fix is required before the user can safely continue.
  • Your release policy requires 100 % of active users to migrate before a certain date.
For routine feature releases or minor improvements, prefer Flexible updates to avoid disrupting the user experience.
Immediate updates forcibly interrupt the user session. Reserve this flow for genuinely critical updates. Overusing it erodes user trust and increases uninstall rates.

How the Immediate update flow works

1

Check for an available update

Call checkForUpdate(UpdateFlow.IMMEDIATE). The library queries the Play Store for the app’s update availability.
2

Full-screen prompt is displayed

If an update is available, Google Play overlays a full-screen UI that the user cannot dismiss on most devices. The user must accept to continue.
3

User downloads and installs

Google Play handles the download and installation entirely within the full-screen UI. Progress is shown to the user in real time.
4

App restarts automatically

Once installation completes, the app restarts with the new version running. The Promise resolves with "Update flow finished".

Promise outcomes

ValueTypeMeaning
"No update available"ResolvedPlay Store reports the app is already up to date.
"Update flow finished"ResolvedInstallation completed and the app has restarted.
"UPDATE_CANCELLED"RejectedThe user dismissed the update dialog (on devices that allow it).
On many devices the immediate update UI cannot be dismissed by the user — the back button and gesture navigation are disabled by the Play Core overlay. However, Google does not guarantee this on all manufacturers, so always handle UPDATE_CANCELLED in your rejection path.

Full code example

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

async function triggerImmediateUpdate() {
  try {
    const result = await checkForUpdate(UpdateFlow.IMMEDIATE);

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

    // result === 'Update flow finished'
    // The app has already restarted at this point.
    // Code below this line is unlikely to execute.
    console.log('Update completed successfully.');
  } catch (error: any) {
    if (error.code === 'UPDATE_CANCELLED') {
      // User dismissed the prompt (rare, device-dependent).
      // You may want to re-trigger the update check on next resume.
      console.warn('User cancelled the update.');
    } else {
      console.error('Update failed:', error.message);
    }
    // See /guides/error-handling for all error codes
  }
}

What happens after the app restarts

Once "Update flow finished" resolves, the Play Core library has already restarted the app process with the new version. Any state stored only in memory (React component state, non-persisted stores) is lost. Persist any critical session data before calling checkForUpdate if the update is triggered mid-session.

Handling cancellation on resume

If the user manages to cancel the immediate update on a device that permits it, checkForUpdate rejects with code: "UPDATE_CANCELLED". A common pattern is to re-trigger the check every time the app returns to the foreground using React Native’s AppState API (shown in the example above). This ensures the user cannot bypass the update by repeatedly dismissing.

Error handling

See the Error Handling guide for the full list of rejection codes, including NOT_ALLOWED, NO_ACTIVITY, and UPDATE_CHECK_FAILED, along with recommended recovery actions for each.

Build docs developers (and LLMs) love