A minimal React Native module that displays the native Android in-app update popup using the Play Core library. Supports both immediate and flexible update types.
npm install react-native-rn-in-app-updateA minimal React Native module that displays the native Android in-app update popup using the Play Core library. Supports both immediate and flexible update types.
Using npm:
``sh md title="Terminal"`
npm install react-native-rn-in-app-update
or using yarn:
`sh md title="Terminal"`
yarn add react-native-rn-in-app-update
Import and use the showUpdatePopup function. it supports 2 update type immediate and flexible
`tsx md title="App.tsx"
import { showUpdatePopup } from 'react-native-rn-in-app-update';
getUpdateInfo is used to get information about the available update.
`tsx md title="App.tsx"`
const info = await getUpdateInfo();
startFlexibleUpdateWithProgress is used to start flexible update while also getting the download percentage.
`tsx md title="App.tsx"
import { startFlexibleUpdateWithProgress } from 'react-native-rn-in-app-update';
title="Start Flexible Update"
onPress={() => startFlexibleUpdateWithProgress()}
/>;
`
subscribeToUpdateProgress is used to get the download percentage when updating app with startFlexibleUpdateWithProgress.
`tsx md title="App.tsx"
import { subscribeToUpdateProgress } from 'react-native-rn-in-app-update';
useEffect(() => {
if (Platform.OS !== 'android') return;
const unsubscribe = subscribeToUpdateProgress(
({ bytesDownloaded, totalBytesToDownload }) => {
if (totalBytesToDownload > 0) {
const percent = (bytesDownloaded / totalBytesToDownload) * 100;
console.log({ percent });
}
}
);
return () => {
unsubscribe();
};
}, []);
`
To test this package correctly, you must publish your app to the Play Store (even if only in Internal Testing) — the in-app update API only works when your app is installed via Google Play.
Create a signed APK/AAB with version:
`sh`
versionCode 100
versionName "1.0.0"
Upload this build to the Play Console → Internal Testing track.
Publish it and wait until it’s available for testers (usually within 15–30 minutes).
Install the app from the Play Store using a tester account.
Increment version:
`sh`
versionCode 101
versionName "1.1.0"
DO NOT UPLOAD IT YET.
This is your update version, which the Play Store will later offer as an available update.
Ensure your app runs this on launch or on button click:
`tsx`
showUpdatePopup('immediate');
At this point, no popup will appear, because there's no newer version yet.
Now upload the v2 build (with versionCode = 101) to Internal Testing.
Publish and wait until it’s live for testers (can take up to 30–60 minutes).
Reopen the installed v1 app on your test device (it’s still running versionCode = 100).
You should now see the in-app update popup, triggered by:
`tsx``
showUpdatePopup('immediate');
Find more details for testing here
We are a 130+ people company developing and designing multiplatform applications using the Lean & Agile methodology. To get more information on the solutions that would suit your needs, feel free to get in touch by email or through or contact form!
We will always answer you with pleasure 😁
This project is licensed under the MIT License - see the LICENSE file for details