Skip to content

Commit b0f7eb1

Browse files
authored
Merge pull request lugg#35 from designorant/patch-1
Cut down some unnecessary setup instructions
2 parents a300296 + 5d87574 commit b0f7eb1

File tree

1 file changed

+5
-43
lines changed

1 file changed

+5
-43
lines changed

README.md

Lines changed: 5 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -121,61 +121,23 @@ Install the package:
121121
$ npm install react-native-config --save
122122
```
123123
124-
Then follow the platform-specific instructions below:
124+
Link the library:
125125
126-
127-
### iOS
128-
129-
Link the library with [rnpm](https://github.com/rnpm/rnpm):
130-
131-
```
132-
$ rnpm link react-native-config
133126
```
134-
135-
136-
### Android
137-
138-
Include this module in `android/settings.gradle`:
139-
127+
$ react-native link react-native-config
140128
```
141-
include ':react-native-config'
142-
include ':app'
143129
144-
project(':react-native-config').projectDir = new File(rootProject.projectDir,
145-
'../node_modules/react-native-config/android')
146-
```
130+
### Extra step for Android
147131
148-
Apply a plugin and add dependency to your app build, in `android/app/build.gradle`:
132+
Apply a plugin to your app build in `android/app/build.gradle`:
149133
150134
```
151135
// 2nd line, add a new apply:
152136
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"
153-
154-
// down below, add new compile:
155-
dependencies {
156-
...
157-
compile project(':react-native-config')
158-
}
159137
```
160138
161-
Change your main application to add a new package, in `android/app/src/main/.../MainApplication.java`:
162-
163-
```java
164-
import com.lugg.ReactNativeConfig.ReactNativeConfigPackage; // add import
165-
166-
public class MainApplication extends Application implements ReactApplication {
167-
// ...
168-
169-
@Override
170-
protected List<ReactPackage> getPackages() {
171-
return Arrays.<ReactPackage>asList(
172-
new MainReactPackage(),
173-
new ReactNativeConfigPackage() // add package
174-
);
175-
}
176-
```
177139
178-
##### Advanced Setup
140+
#### Advanced Android Setup
179141
180142
In `android/app/build.gradle`, if you use `applicationIdSuffix` or `applicationId` that is different from the package name indicated in `AndroidManifest.xml` in `<manifest package="...">` tag, for example, to support different build variants:
181143
Add this in `android/app/build.gradle`

0 commit comments

Comments
 (0)