react-native-simple-version-update is a lightweight and easy-to-use custom React Native hook that checks if your app needs to be updated by comparing the installed version with the latest version available on the App Store (iOS) or Google Play Store (Andr
npm install react-native-simple-version-update


The easiest way to check for React Native app updates! A lightweight, zero-configuration React Native hook that automatically detects if your mobile app needs to be updated by comparing the installed version with the latest version available on the App Store (iOS) and Google Play Store (Android).
Perfect for React Native developers who need to:
- ✅ Check app version updates automatically
- ✅ Detect when users need to update their app
- ✅ Redirect users to App Store or Play Store for updates
- ✅ Compare semantic versions correctly (1.10.0 vs 1.9.0)
- ✅ Support both iOS and Android platforms
- ✅ Get TypeScript support out of the box
- ✅ Automatic Version Detection - Fetches current app version from device using react-native-device-info
- ✅ App Store Integration - Gets latest iOS version from iTunes API using bundle ID
- ✅ Play Store Integration - Scrapes Google Play Store to find latest Android version
- ✅ Smart Version Comparison - Properly compares semantic versions (handles 1.10.0 vs 1.9.0 correctly)
- ✅ Loading & Error States - Built-in loading indicators and error handling for better UX
- ✅ Manual Refresh - Trigger version checks on-demand with checkForUpdate()
- ✅ Store Redirect - Automatically opens App Store or Play Store for app updates
- ✅ TypeScript Support - Full TypeScript definitions included
- ✅ Zero Configuration - Works out of the box, no setup required
- ✅ React Native Hook - Simple, clean API using React hooks pattern
Install the React Native version update checker package along with its peer dependency:
``bash`
npm install react-native-simple-version-update react-native-device-info
`bash`
yarn add react-native-simple-version-update react-native-device-info
`bash`
pnpm add react-native-simple-version-update react-native-device-info
> Note: This package requires react-native-device-info as a peer dependency to get the current app version and bundle ID.
For iOS, you may need to add the following to your Info.plist to allow network requests:
`xml`
For Android, ensure you have the INTERNET permission in your AndroidManifest.xml (usually already present):
`xml`
This React Native version update hook is perfect for:
- Forcing App Updates - Require users to update before using the app
- Update Notifications - Show update prompts when new versions are available
- Version Monitoring - Track which app versions users are running
- Critical Updates - Force updates for security patches or breaking changes
- App Store Compliance - Ensure users are on supported app versions
`javascript
import React from 'react';
import { Text, View, Modal, Button, ActivityIndicator } from 'react-native';
import useVersionUpdate from 'react-native-simple-version-update';
const App = () => {
const {
currentVersion,
liveVersion,
needUpdate,
isLoading,
error,
handleUpdate,
checkForUpdate,
} = useVersionUpdate();
if (isLoading) {
return (
);
}
return (
{error &&
{/ Show modal if update is needed /}
{needUpdate && (
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'rgba(0, 0, 0, 0.5)',
}}
>
backgroundColor: 'white',
padding: 20,
borderRadius: 10,
minWidth: 300,
}}
>
A new version ({liveVersion}) is available. Please update to continue.
)}
);
};
export default App;
`
`typescript
import React from 'react';
import { View, Text, Button } from 'react-native';
import useVersionUpdate from 'react-native-simple-version-update';
const App: React.FC = () => {
const {
currentVersion,
liveVersion,
needUpdate,
isLoading,
error,
handleUpdate,
checkForUpdate,
} = useVersionUpdate();
return (
{needUpdate && }
);
};
export default App;
`
Returns an object with the following properties:
| Property | Type | Description |
| ---------------- | --------------------- | ----------------------------------------- |
| currentVersion | string \| null | The currently installed app version |liveVersion
| | string \| null | The latest version available on the store |needUpdate
| | boolean | Whether an update is required |isLoading
| | boolean | Whether the version check is in progress |error
| | Error \| null | Any error that occurred during the check |handleUpdate
| | () => Promise | Opens the app store page for updating |checkForUpdate
| | () => Promise | Manually trigger a version check |
The useVersionUpdate hook performs the following steps:
1. Version Detection: Uses react-native-device-info to get the current installed app version from the deviceitunes.apple.com/lookup
2. Store Lookup:
- iOS: Queries the iTunes App Store API () using the app's bundle IDhandleUpdate()
- Android: Scrapes the Google Play Store page using multiple regex patterns for maximum reliability
3. Version Comparison: Implements proper semantic versioning comparison algorithm (correctly handles cases like 1.10.0 > 1.9.0)
4. Update Detection: Compares current version vs. live version to determine if an update is needed
5. Store Redirect: Opens the appropriate App Store or Play Store URL when is called
- iOS: Uses official iTunes Search API - reliable and fast
- Android: Uses HTML parsing with multiple fallback patterns to handle Google Play Store layout changes
- Version Parsing: Normalizes version strings and compares numerically (not as strings)
- Error Handling: Gracefully handles network errors, missing apps, and API failures
- Automatic Check: The hook automatically checks for updates when the component mounts
- Semantic Versioning: Version comparison follows semantic versioning (semver) rules
- Network Required: Network requests are required to fetch store versions - will fail if device is offline
- Android Parsing: Android version detection uses HTML parsing - may need updates if Google changes Play Store structure
- Bundle ID: Make sure your app's bundle ID matches the one published on App Store/Play Store
- Rate Limiting: Be mindful of API rate limits when checking versions frequently
Use the checkForUpdate() function returned by the hook:
`javascript
const { checkForUpdate } = useVersionUpdate();
// Later in your code
await checkForUpdate();
`
Yes! This package works with Expo managed workflow, but you'll need to install react-native-device-info which may require a custom development build for some features.
Absolutely! The hook only provides the data - you have full control over the UI. Check the examples above for custom modal implementations.
The hook will set the error state, and you can handle it gracefully in your UI. The isLoading state will be set to false.
Yes, but the version must be published to the public App Store or Play Store for the API to return it.
Yes! You can check needUpdate and prevent app usage until they update:
`javascript`
if (needUpdate) {
// Show blocking modal, disable app features, etc.
}
| Feature | react-native-simple-version-update | react-native-version-check | react-native-update-apk |
| ------------------- | ---------------------------------- | -------------------------- | ----------------------- |
| iOS Support | ✅ | ✅ | ❌ |
| Android Support | ✅ | ✅ | ✅ |
| Zero Config | ✅ | ❌ | ❌ |
| TypeScript | ✅ | ❌ | ❌ |
| Semantic Versioning | ✅ | ⚠️ | ⚠️ |
| Loading States | ✅ | ❌ | ❌ |
| Error Handling | ✅ | ⚠️ | ⚠️ |
Contributions are welcome! If you'd like to contribute to this React Native version update package:
1. Fork the repository
2. Create a feature branch (git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature'
3. Commit your changes ()git push origin feature/amazing-feature
4. Push to the branch ()
5. Open a Pull Request
`bashClone the repository
git clone https://github.com/tyfonas1/react-native-simple-version-update.git
Contributions are welcome! If you'd like to contribute to this package:
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
Avraam Gkoutzeloudis
- GitHub: @tyfonas1
- Package: npmjs.com/package/react-native-simple-version-update
If this package helped you, please give it a ⭐ on GitHub and share it with other React Native developers!
- react-native-device-info - Device information for React Native
- react-native - React Native framework
- semver - Semantic Versioning specification
---
Keywords: react native version check, react native app update, react native version comparison, app store version check, play store version check, react native hook, version update hook, semantic versioning react native, force app update react native, check app version react native