React Native API
getAppVersion
The `HotUpdater.getAppVersion()` function returns the current native app version embedded at build time.
Usage
Use HotUpdater.getAppVersion() to read the app version from the native build.
This is useful for diagnostics, showing version info in settings screens, and
custom update logic.
import { HotUpdater } from "@hot-updater/react-native";
import { Text, View } from "react-native";
function App() {
const appVersion = HotUpdater.getAppVersion();
return (
<View>
<Text>App Version: {appVersion ?? "unknown"}</Text>
</View>
);
}
export default App;Return Value
getAppVersion(): string | null- Returns a version string when available (for example:
"1.2.3"). - Returns
nullwhen the native constant is unavailable.
Behavior
getAppVersion()is synchronous.- The value is sourced from native app metadata:
- iOS:
CFBundleShortVersionStringinInfo.plist - Android:
PackageInfo.versionName
- iOS:
- The native module then exposes this as
APP_VERSION, andHotUpdater.getAppVersion()returns that bridged value. - It does not make a network request.