@vuduc0801/react-native-version-check
v4.0.0
Published
App version checker for React Native. Fork of react-native-version-check with a built-in Expo entry point (@vuduc0801/react-native-version-check/expo) updated for Expo SDK 53+, and no lodash dependency.
Downloads
44
Maintainers
Readme
@vuduc0801/react-native-version-check
App version checker for React Native. Fork of
react-native-version-check
3.5.0, with the Expo entry point built in and updated for Expo SDK 53+.
Why this fork exists
Upstream ships the Expo variant as a separate package, react-native-version-check-expo,
which declares expo-constants@^14.0.2 and expo-localization@^14.0.0 as hard dependencies.
On Expo SDK 53 that pulls [email protected] into the tree, whose
LocalizationModule.swift is missing an @unknown default case and fails to compile against
the Xcode 26 / iOS SDK 26.2 toolchain:
LocalizationModule.swift:94:5: error: switch must be exhaustiveA stale [email protected] gets installed as a nested duplicate at the same time.
This fork merges the two packages into one and makes the Expo modules optional peers, so the host app's own SDK-matched versions are always used.
Install
npm install @vuduc0801/react-native-version-checkFor the Expo entry point, install the peers at the versions your Expo SDK pins:
npx expo install expo-constants expo-localizationUsage
Bare React Native — uses the bundled native module:
import VersionCheck from '@vuduc0801/react-native-version-check';Expo — reads the manifest through expo-constants, no native module required:
import VersionCheck from '@vuduc0801/react-native-version-check/expo';
const update = await VersionCheck.needUpdate();
if (update.isNeeded) {
Linking.openURL(update.storeUrl);
}Both entries expose the same API: getCurrentVersion, getCurrentBuildNumber,
getPackageName, getCountry, getStoreUrl, getAppStoreUrl, getPlayStoreUrl,
getLatestVersion, needUpdate. Full option reference:
kimxogus/react-native-version-check.
Skipping the native module on Expo
If you only use the /expo entry, opt out of native autolinking in your app's
react-native.config.js so the Android and iOS sources are never built:
module.exports = {
dependencies: {
'@vuduc0801/react-native-version-check': {
platforms: { android: null, ios: null },
},
},
};Changes vs upstream 3.5.0
Expo
- Expo support moved in-package as
@vuduc0801/react-native-version-check/expo; the separatereact-native-version-check-expopackage is no longer needed. expo-constantsandexpo-localizationare optional peer dependencies, so no duplicate native module is ever installed.- Country detection uses
Localization.getLocales()[0].regionCode. The legacyLocalization.country/Localization.regionconstants it relied on were removed inexpo-localization16. - Reading the manifest no longer throws when both
Constants.expoConfigandConstants.manifest2are absent. - Dropped the dead
Constants.expoVersion < 31branch —expoVersionis undefined outside Expo Go.
JS
- Dropped the
lodashdependency;isNilandisFunctionare two local one-liners. semverbumped from^6.1.1to^7.6.3.
Android
- Added
namespacetoandroid/build.gradleand removedpackagefrom the manifest, which AGP 8 requires. - Removed the hardcoded
abiFilters "armeabi-v7a", "x86"— it excludedarm64-v8a. - Defaults raised to compileSdk/targetSdk 35, minSdk 24; Java 17; dropped the pinned
buildToolsVersionand thecom.facebook.react:react-native:+dynamic version.
iOS
- Podspec deployment target raised from 7.0 to 15.1 and given a proper source tag.
- Removed the unused legacy
ios/RNVersionCheck.xcodeproj.
License
MIT. Original work by Taehyun Kim and contributors.
