{"id":16810243,"url":"https://github.com/tessus/react-native-version-info","last_synced_at":"2025-05-06T21:29:07.146Z","repository":{"id":46715554,"uuid":"154222064","full_name":"tessus/react-native-version-info","owner":"tessus","description":"Version Information for React Native Android, iOS, and Windows ","archived":false,"fork":false,"pushed_at":"2024-03-10T06:33:32.000Z","size":111,"stargazers_count":46,"open_issues_count":0,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-24T03:02:04.936Z","etag":null,"topics":["react-android","react-ios","react-native","react-windows"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-native-version-info","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tessus.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-22T21:50:18.000Z","updated_at":"2024-09-10T10:47:24.000Z","dependencies_parsed_at":"2024-03-10T07:30:47.492Z","dependency_job_id":"ecf3391d-1059-4f9f-bef7-055615420662","html_url":"https://github.com/tessus/react-native-version-info","commit_stats":{"total_commits":89,"total_committers":24,"mean_commits":"3.7083333333333335","dds":0.4157303370786517,"last_synced_commit":"897cba289e10a6fc3e944c27b8d5bb2cd6630c24"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tessus%2Freact-native-version-info","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tessus%2Freact-native-version-info/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tessus%2Freact-native-version-info/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tessus%2Freact-native-version-info/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tessus","download_url":"https://codeload.github.com/tessus/react-native-version-info/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252420967,"owners_count":21745154,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["react-android","react-ios","react-native","react-windows"],"created_at":"2024-10-13T10:14:53.525Z","updated_at":"2025-05-06T21:29:07.128Z","avatar_url":"https://github.com/tessus.png","language":"C#","readme":"# react-native-version-info\n\n[![npm](https://img.shields.io/npm/v/react-native-version-info.svg?style=flat\u0026colorB=CB3837)](https://www.npmjs.com/package/react-native-version-info)\n![Build Status](https://github.com/tessus/react-native-version-info/actions/workflows/node.js.yml/badge.svg)\n\n\u003c!--\n![Downloads per month](https://img.shields.io/npm/dm/react-native-version-info.svg?colorB=blue)\n![Downloads total](https://img.shields.io/npm/dt/react-native-version-info.svg?colorB=blue)\n--\u003e\n\nReturns `CFBundleShortVersionString`, `CFBundleVersion`, and `CFBundleIdentifier` on iOS. For Android, returns `versionName`, `versionCode`, and `applicationId`. For Windows, returns the `version` properties `major, minor, and build` numbers as the appVersion, the `revision` number as the buildVersion, and the `name` property as the bundleIdentifier.\n\n|                  | Android         | iOS                          | Windows              | Example            |\n| ---------------- | --------------- | ---------------------------- | -------------------- | ------------------ |\n| appVersion       | `versionName`   | `CFBundleShortVersionString` | `Identity[version]`  | `1.0.2`            |\n| buildVersion     | `versionCode`   | `CFBundleVersion`            | `Identity[revision]` | `42`               |\n| bundleIdentifier | `applicationId` | `CFBundleIdentifier`         | `Identity[name]`     | `com.foo.bar.MyApp`|\n\n## Installation\n\nUsing npm:\n\n```shell\nnpm install react-native-version-info\n```\n\nor using yarn:\n\n```shell\nyarn add react-native-version-info\n```\n\n## Linking\n\n### Automatic\n\n```shell\nreact-native link react-native-version-info\n```\n\n**iOS:** If you are using pods in your project, don't forget to run `pod update`.\n\n### Manual\n\n#### Android\n\n1. In your android/settings.gradle file, make the following additions:\n\n\t```java\n\tinclude ':react-native-version-info'\n\tproject(':react-native-version-info').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-version-info/android')\n\t```\n\n2. In your android/app/build.gradle file, add the `:react-native-version-info` project as a compile-time dependency:\n\n\t```java\n\t...\n\tdependencies {\n\t    ...\n\t    implementation project(':react-native-version-info')\n\t}\n\t```\n\n3. Update the MainApplication.java file to use `react-native-version-info` via the following changes:\n\n\t```java\n\timport cx.evermeet.versioninfo.RNVersionInfoPackage;\n\n\tpublic class MainApplication extends Application implements ReactApplication {\n\n\t    private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {\n\t        ...\n\t        @Override\n\t        protected List\u003cReactPackage\u003e getPackages() {\n\t            return Arrays.\u003cReactPackage\u003easList(\n\t                    new MainReactPackage(),\n\t                    new RNVersionInfoPackage(), // here\n\t            );\n\t        }\n\t    };\n\t    ...\n\t}\n\t```\n\n#### iOS\n\nIn XCode, in the project navigator:\n\n- Right click _Libraries_\n- Add Files to _[your project's name]_\n- Go to `node_modules/react-native-version-info/ios`\n- Add the `.xcodeproj` file\n\nIn XCode, in the project navigator, select your project.\n\n- Add the `libRNVersionInfo.a` (in subdir `Products`) from the _VersionInfo_ project to your project's _Build Phases ➜ Link Binary With Libraries_ (Note: the library file does not exist yet, thus it will show up as red.)\n- Click the `.xcodeproj` file you added before in the project navigator and go the _Build Settings_ tab. Make sure _All_ is toggled on (instead of _Basic_). Look for _Header Search Paths_ and make sure it contains both `$(SRCROOT)/../react-native/React` and `$(SRCROOT)/../../React`\n\n#### Windows\n\n1. In your `windows/{app_name}/MainReactNativeHost` file add the `RNVersionInfo` package to the package list:\n\n\t```c#\n\tusing cx.evermeet.versioninfo;\n\t...\n\tprotected override List\u003cIReactPackage\u003e Packages =\u003e new List\u003cIReactPackage\u003e\n\t{\n\t    ...\n\t    new RNVersionInfoPackage(),\n\t};\n\t```\n\n2. Add `RNVersionInfo` to your solution\n\n3. Add `RNVersionInfo` to your ReactNative project's references\n\nFor a step by step guide visit:\nhttps://github.com/Microsoft/react-native-windows/blob/master/docs/LinkingLibrariesWindows.md\n\n## Changelog\n\nA Changelog is included in the package, but also [available for viewing](https://github.com/tessus/react-native-version-info/blob/master/CHANGELOG.md) in the repo on GitHub.\n\n## FAQ\n\n### Why the jump from version `0.6.2` to `1.0.0`?\n\nThe package is considered stable. To follow the [semantic versioning](https://semver.org/) specification the version had to be set to `1.0.0`.\n\n### Why does Automatic Linking not work for iOS?\n\nIt does. However, please be aware of the following (from the [react-native documentation](https://facebook.github.io/react-native/docs/linking-libraries-ios#automatic-linking)): *If your iOS project is using CocoaPods (contains Podfile) and linked library has podspec file, then react-native link will link library using Podfile.*\nIn such a case, don't forget to run `pod update`.\n\n## Usage\n\n```javascript\nimport VersionInfo from 'react-native-version-info';\n\nconsole.log(VersionInfo.appVersion);\nconsole.log(VersionInfo.buildVersion);\nconsole.log(VersionInfo.bundleIdentifier);\n```\n\n## License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftessus%2Freact-native-version-info","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftessus%2Freact-native-version-info","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftessus%2Freact-native-version-info/lists"}