Skip to main content
The VersionCheck object provides all version-check APIs in one convenient interface. It includes both synchronous properties for immediate access to app metadata and asynchronous methods for checking updates and store information.

Overview

All version-check APIs in one object.
import { VersionCheck } from 'react-native-nitro-version-check';

VersionCheck.version      // "1.2.0"
VersionCheck.buildNumber  // "42"
VersionCheck.packageName  // "com.example.app"
VersionCheck.getCountry() // "US"

const url = await VersionCheck.getStoreUrl();

Properties

version

version
string
The current app version string.Read from CFBundleShortVersionString on iOS and versionName on Android. Cached at module init, so repeated reads have zero native overhead.
VersionCheck.version // "1.2.0"

buildNumber

buildNumber
string
The current build number.Read from CFBundleVersion on iOS and versionCode on Android. Cached at module init.
VersionCheck.buildNumber // "42"

packageName

packageName
string
The app’s unique identifier.This is the Bundle ID on iOS and the Application ID on Android. Cached at module init.
VersionCheck.packageName // "com.example.app"

installSource

installSource
string | undefined
Where the app was installed from, or undefined for dev/sideloaded builds.
  • iOS: "appstore" | "testflight" | undefined
  • Android: "playstore" | undefined
if (VersionCheck.installSource === "testflight") {
  // running a TestFlight build
}

Methods

getCountry()

Returns the device’s current 2-letter ISO country code. This is a synchronous Nitro call, no await needed.
return
string
2-letter ISO country code (e.g., "US", "GB", "JP")
const country = VersionCheck.getCountry(); // "US"

getStoreUrl()

Returns the App Store (iOS) or Play Store (Android) URL for this app.
return
Promise<string>
Store URL for the current app
const url = await VersionCheck.getStoreUrl();
Linking.openURL(url);

getLatestVersion()

Fetches the latest version of this app available in the store. Queries the iTunes API on iOS and the Play Store on Android.
return
Promise<string>
Latest version available in the app store (e.g., "1.3.0")
const latest = await VersionCheck.getLatestVersion(); // "1.3.0"
console.log(`Latest version: ${latest}`);

needsUpdate()

Checks whether an app update is available by comparing the current version against the latest store version.
return
Promise<boolean>
true if an update is available, false otherwise
if (await VersionCheck.needsUpdate()) {
  const url = await VersionCheck.getStoreUrl();
  Linking.openURL(url);
}

Build docs developers (and LLMs) love