From bed2b716d3678cb97305d8fb416b69001f0cd2c4 Mon Sep 17 00:00:00 2001 From: YuliaGrigorieva Date: Fri, 6 Jul 2018 12:21:24 +0300 Subject: [PATCH] Update README --- README.md | 68 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index c0d5af7..ae6480a 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,8 @@ You can get the demo app from [http://github.com/voximplant/react-native-demo](h 5. Add `use_frameworks!` at the top of your target configuration 6. Run `pod install` from /ios/ 7. Start XCode and open generated .xcworkspace -8. Check in project navigation that there is no `*.xcodeproj` in `Libraries` section. In case of any please remove them. Since React dependencies are added via Podfile, double integration of its modules may lead to unpredictable/incorrect behavior of an application. +8. Check if there is no `*.xcodeproj` in the project navigation (see the `Libraries` section). In case of any please remove them. + Since React dependencies are added via Podfile, double integration of its modules may lead to unpredictable/incorrect behavior of an application. 9. Run your project (`Cmd+R`) ### Android @@ -42,37 +43,52 @@ You can get the demo app from [http://github.com/voximplant/react-native-demo](h 1. Make sure you have "React Native" project created with `react-native init` 2. `cd` into a project directory where `package.json` file is located. 3. Run `npm install react-native-voximplant@latest --save` -4. It is required to add Java 8 support. Open `android/app/build.gradle` file and add the following lines to ‘android’ section: - ``` - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - ``` -5. Open up `android/app/main/java/[...]/MainApplication.java` +4. It is required to add Java 8 support. + - Open `android/app/build.gradle` file and add the following lines to ‘android’ section: + ``` + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + ``` + - If you're using gradle version < 3.0.0, do this step and the next one OR run the `gradle sync` command in Android Studio, then follow the provided hints. + Open the `android/build.gradle` file and update the Android plugin for gradle: + ``` + dependencies { + // use the latest available version + classpath 'com.android.tools.build:gradle:3.1.3' + }​ + + ``` + - Open the android/gradle/wrapper/gradle-wrapper.properties file and edit the distributionUrl to gradle-4.4-all.zip: + ``` + distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip + ``` +5. Run the `react-native link` command to link react-native-voximplant Android dependency OR perform the following steps: + - Open up `android/app/main/java/[...]/MainApplication.java` - Add `import com.voximplant.reactnative.VoxImplantReactPackage;` to the imports at the top of the file - - Add `new VoxImplantReactPackage()` to the list returned by the `getPackages()` method - -6. Append the following lines to `android/settings.gradle`: - - ``` - include ':react-native-voximplant' - project(':react-native-voximplant').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-voximplant/android') - ``` - -7. Insert the following lines inside the dependencies block in `android/app/build.gradle`: - - ``` - compile project(':react-native-voximplant') - ``` + + Add `new VoxImplantReactPackage()` to the list returned by the `getPackages()` method + + - Append the following lines to `android/settings.gradle`: + + ``` + include ':react-native-voximplant' + project(':react-native-voximplant').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-voximplant/android') + ``` + - Insert the following lines inside the dependencies block in `android/app/build.gradle`: + + ``` + compile project(':react-native-voximplant') + ``` ## Usage -You will need free VoxImplant developer account setup for making and receiving calls using the SDK. +You will need free Voximplant developer account setup for making and receiving calls using the SDK. Learn more at [quick start](https://voximplant.com/docs/references/articles/quickstart). Official guides: -- [React Native SDK quick start quide](#) -- [Migration guide](#) +- [Using React Native SDK guide](https://voximplant.com/blog/using-react-native-sdk) +- [Migration guide](https://voximplant.com/blog/migration-guide-for-react-native-sdk) ## Todo