{"id":19499677,"url":"https://github.com/apsl/react-native-version-number","last_synced_at":"2025-05-15T16:07:31.591Z","repository":{"id":49257391,"uuid":"66629095","full_name":"APSL/react-native-version-number","owner":"APSL","description":"Gets the version number and build number of your app.","archived":false,"fork":false,"pushed_at":"2024-05-03T23:25:12.000Z","size":29,"stargazers_count":381,"open_issues_count":15,"forks_count":141,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-08T03:05:36.676Z","etag":null,"topics":["android","ios","react-native"],"latest_commit_sha":null,"homepage":null,"language":"Java","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/APSL.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2016-08-26T08:05:19.000Z","updated_at":"2025-03-04T13:39:58.000Z","dependencies_parsed_at":"2024-06-18T12:37:11.498Z","dependency_job_id":"78a0e030-f240-4f52-bb66-6ba94973e62e","html_url":"https://github.com/APSL/react-native-version-number","commit_stats":{"total_commits":37,"total_committers":22,"mean_commits":"1.6818181818181819","dds":0.6756756756756757,"last_synced_commit":"7d7e0f2d0938745d149a28134d11a9867d5e9b4a"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/APSL%2Freact-native-version-number","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/APSL%2Freact-native-version-number/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/APSL%2Freact-native-version-number/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/APSL%2Freact-native-version-number/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/APSL","download_url":"https://codeload.github.com/APSL/react-native-version-number/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254374475,"owners_count":22060611,"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":["android","ios","react-native"],"created_at":"2024-11-10T22:05:38.099Z","updated_at":"2025-05-15T16:07:31.537Z","avatar_url":"https://github.com/APSL.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# react-native-version-number\n\n\u003cp\u003e\n\u003cimg src=\"https://travis-ci.org/APSL/react-native-version-number.svg?branch=master\" /\u003e\n\u003cimg src=\"https://img.shields.io/npm/dm/react-native-version-number.svg\" /\u003e\n\u003cimg src=\"https://img.shields.io/npm/dt/react-native-version-number.svg\" /\u003e\n\u003c/p\u003e\n\nReturns the `CFBundleShortVersionString` and the `CFBundleVersion` and `bundleIdentifier` on IOS. For Android, returns the `versionName`, `versionCode` and `applicationId`.\n\n\n|  | iOS | Android | Example |\n| --- | --- | --- | --- |\n| appVersion | `CFBundleShortVersionString` | `versionName` | `1.0.2` |\n| buildVersion | `CFBundleVersion` | `versionCode` | `42` |\n| bundleIdentifier | `bundleIdentifier` | `applicationId` | `com.foo.bar.MyApp`|\n\n\n## Getting started\n\nInstall the package\n\n`$ yarn add react-native-version-number`\n\nLink\n\n`$ react-native link react-native-version-number`\n\n#### Manual installation  \n\n**Android:**\n\n1. In your android/settings.gradle file, make the following additions:\n```java\ninclude ':react-native-version-number'   \nproject(':react-native-version-number').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-version-number/android')\n```\n\n2. In your android/app/build.gradle file, add the `:react-native-version-number` project as a compile-time dependency:\n\n```java\n...\ndependencies {\n    ...\n    compile project(':react-native-version-number')\n}\n```\n\n3. Update the MainApplication.java file to use `react-native-version-number` via the following changes:   \n\n```java\nimport com.apsl.versionnumber.RNVersionNumberPackage;\n\npublic class MainApplication extends Application implements ReactApplication {\n\n    private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {\n        ...\n        @Override\n        protected List\u003cReactPackage\u003e getPackages() {\n            return Arrays.\u003cReactPackage\u003easList(\n                    new MainReactPackage(),\n                    new RNVersionNumberPackage(), // here\n            );\n        }\n    };\n    ...\n}\n```\n\n\n## Usage\n```javascript\nimport VersionNumber from 'react-native-version-number';\n\nconsole.log(VersionNumber.appVersion);\nconsole.log(VersionNumber.buildVersion);\nconsole.log(VersionNumber.bundleIdentifier);\n\n```\n\n## License\nMIT.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapsl%2Freact-native-version-number","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapsl%2Freact-native-version-number","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapsl%2Freact-native-version-number/lists"}