Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

react-native-version-number

> 前端框架
Open source

Gets the version number and build number of your app.

379 stars0 likes2 views
WebsiteGitHub

About

Gets the version number and build number of your app.

react-native-version-number

Returns the CFBundleShortVersionString and the CFBundleVersion and bundleIdentifier on IOS. For Android, returns the versionName, versionCode and applicationId.

iOS Android Example
appVersion CFBundleShortVersionString versionName 1.0.2
buildVersion CFBundleVersion versionCode 42
bundleIdentifier bundleIdentifier applicationId com.foo.bar.MyApp

Getting started

Install the package

$ yarn add react-native-version-number

Link

$ react-native link react-native-version-number

Manual installation

Android:

  1. In your android/settings.gradle file, make the following additions:
java
include ':react-native-version-number'   
project(':react-native-version-number').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-version-number/android')
  1. In your android/app/build.gradle file, add the :react-native-version-number project as a compile-time dependency:
java
...
dependencies {
    ...
    compile project(':react-native-version-number')
}
  1. Update the MainApplication.java file to use react-native-version-number via the following changes:
java
import com.apsl.versionnumber.RNVersionNumberPackage;

public class MainApplication extends Application implements ReactApplication {

    private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
        ...
        @Override
        protected List getPackages() {
            return Arrays.asList(
                    new MainReactPackage(),
                    new RNVersionNumberPackage(), // here
            );
        }
    };
    ...
}

Usage

javascript
import VersionNumber from 'react-native-version-number';

console.log(VersionNumber.appVersion);
console.log(VersionNumber.buildVersion);
console.log(VersionNumber.bundleIdentifier);

License

MIT.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Javaandroidiosreact-native

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架