File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727
2828` $ react-native link `
2929
30+ #### Manual installation
31+
32+ ** Android:**
33+
34+ 1 . In your android/settings.gradle file, make the following additions:
35+ ``` java
36+ include ' :react-native-version-number'
37+ project(' :react-native-version-number' ). projectDir = new File (rootProject. projectDir, ' ../node_modules/react-native-version-number/android' )
38+ ```
39+
40+ 2 . In your android/app/build.gradle file, add the ` :react-native-version-number ` project as a compile-time dependency:
41+
42+ ``` java
43+ ...
44+ dependencies {
45+ ...
46+ compile project(' :react-native-version-number' )
47+ }
48+ ```
49+
50+ 3 . Update the MainApplication.java file to use ` react-native-version-number ` via the following changes:
51+
52+ ``` java
53+ import com.apsl.versionnumber.RNVersionNumberPackage ;
54+
55+ public class MainApplication extends Application implements ReactApplication {
56+
57+ private final ReactNativeHost mReactNativeHost = new ReactNativeHost (this ) {
58+ ...
59+ @Override
60+ protected List<ReactPackage > getPackages () {
61+ return Arrays . < ReactPackage > asList(
62+ new MainReactPackage (),
63+ new RNVersionNumberPackage (), // here
64+ );
65+ }
66+ };
67+ ...
68+ }
69+ ```
70+
71+
3072## Usage
3173``` javascript
3274import VersionNumber from ' react-native-version-number' ;
You can’t perform that action at this time.
0 commit comments