Skip to content

Commit

Permalink
Better readme
Browse files Browse the repository at this point in the history
Fixes #701
  • Loading branch information
hyochan committed Sep 7, 2019
1 parent 2edbdf5 commit dd4cf11
Showing 1 changed file with 71 additions and 12 deletions.
83 changes: 71 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,19 +142,73 @@ Getting Started
---------------
`$ npm install --save react-native-iap`

## Getting started

`$ npm install react-native-inappbrowser-reborn --save`

### Mostly automatic installation

#### Using React Native >= 0.60
Linking the package manually is not required anymore with [Autolinking](https://github.com/react-native-community/cli/blob/master/docs/autolinking.md).

- **iOS Platform:**

`$ cd ios && pod install && cd ..` # CocoaPods on iOS needs this extra step

- **Android Platform with Android Support:**

Using [Jetifier tool](https://github.com/mikehardy/jetifier) for backward-compatibility.

Modify your **android/build.gradle** configuration:
```
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 28
# Only using Android Support libraries
supportLibVersion = "28.0.0"
}
```

- **Android Platform with AndroidX:**

Modify your **android/build.gradle** configuration:
```
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 28
# Remove 'supportLibVersion' property and put specific versions for AndroidX libraries
androidXAnnotation = "1.1.0"
androidXBrowser = "1.0.0"
// Put here other AndroidX dependencies
}
```

#### Using React Native < 0.60

`$ react-native link react-native-iap`

### Manual installation

#### iOS
1. In XCode, in the project navigator, right-click `Libraries``Add Files to [your project's name]`
2. Go to `node_modules``react-native-iap` and add `RNIap.xcodeproj`
3. In XCode, in the project navigator, select your project. Add `libRNIap.a`
to your project's `Build Phases``Link Binary With Libraries`
4. Run your project (`Cmd+R`)

1. In XCode, in the project navigator, right click `Libraries``Add Files to [your project's name]`
2. Go to `node_modules``react-native-inappbrowser-reborn` and add `RNInAppBrowser.xcodeproj`
3. In XCode, in the project navigator, select your project. Add `libRNInAppBrowser.a` to your project's `Build Phases``Link Binary With Libraries`
4. Run your project (`Cmd+R`)<

#### iOS with Podfile
1. Open up `ios/Podfile`
- Add `pod 'RNInAppBrowser', :path => '../node_modules/react-native-iap'`
2. Run `pod install`

#### Android

1. Open up `android/app/src/main/java/[...]/MainApplication.java`
- Add `import com.dooboolab.RNIap.RNIapPackage;` to the imports at the top of the file
- Add `new RNIapPackage()` to the list returned by the `getPackages()` method
Expand All @@ -167,14 +221,19 @@ Getting Started
```gradle
compile project(':react-native-iap')
```
4. Add the following to the `<permission>` block in `android/app/src/main/AndroidManifest.xml`:
```xml
<uses-permission android:name="com.android.vending.BILLING" />
4. Update ProGuard config (Optional)
- Append the following lines to your ProGuard config (`proguard-rules.pro`)
```
Migration Guide
---------------
To migrate to `3.1.0` you must migrate your Android app to AndroidX by following the [Migrating to AndroidX Guide][android-migrate-androidx].
-keepattributes *Annotation*
-keepclassmembers class ** {
@org.greenrobot.eventbus.Subscribe <methods>;
}
-keep enum org.greenrobot.eventbus.ThreadMode { *; }
```
5. Add the following to the `<permission>` block in `android/app/src/main/AndroidManifest.xml`:
```xml
<uses-permission android:name="com.android.vending.BILLING" />
```

### Migrating to 3.4.0

Expand Down

0 comments on commit dd4cf11

Please sign in to comment.