Skip to content

Commit

Permalink
Merge pull request lugg#35 from designorant/patch-1
Browse files Browse the repository at this point in the history
Cut down some unnecessary setup instructions
  • Loading branch information
GantMan authored Nov 26, 2016
2 parents a300296 + 5d87574 commit b0f7eb1
Showing 1 changed file with 5 additions and 43 deletions.
48 changes: 5 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,61 +121,23 @@ Install the package:
$ npm install react-native-config --save
```
Then follow the platform-specific instructions below:
Link the library:
### iOS
Link the library with [rnpm](https://github.com/rnpm/rnpm):
```
$ rnpm link react-native-config
```
### Android
Include this module in `android/settings.gradle`:
$ react-native link react-native-config
```
include ':react-native-config'
include ':app'
project(':react-native-config').projectDir = new File(rootProject.projectDir,
'../node_modules/react-native-config/android')
```
### Extra step for Android
Apply a plugin and add dependency to your app build, in `android/app/build.gradle`:
Apply a plugin to your app build in `android/app/build.gradle`:
```
// 2nd line, add a new apply:
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"

// down below, add new compile:
dependencies {
...
compile project(':react-native-config')
}
```
Change your main application to add a new package, in `android/app/src/main/.../MainApplication.java`:
```java
import com.lugg.ReactNativeConfig.ReactNativeConfigPackage; // add import
public class MainApplication extends Application implements ReactApplication {
// ...
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new ReactNativeConfigPackage() // add package
);
}
```
##### Advanced Setup
#### Advanced Android Setup
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:
Add this in `android/app/build.gradle`
Expand Down

0 comments on commit b0f7eb1

Please sign in to comment.