From dd4cf11089c81085934468a3c6c2628107dfc3f5 Mon Sep 17 00:00:00 2001 From: hyochan Date: Sat, 7 Sep 2019 11:33:45 +0900 Subject: [PATCH] Better readme Fixes #701 --- README.md | 83 +++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 71 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 4e99e07bf..65b73d720 100644 --- a/README.md +++ b/README.md @@ -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 @@ -167,14 +221,19 @@ Getting Started ```gradle compile project(':react-native-iap') ``` -4. Add the following to the `` block in `android/app/src/main/AndroidManifest.xml`: - ```xml - +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 ; + } + -keep enum org.greenrobot.eventbus.ThreadMode { *; } + ``` +5. Add the following to the `` block in `android/app/src/main/AndroidManifest.xml`: + ```xml + + ``` ### Migrating to 3.4.0