From fb898880ded16ff1e0b1422b8709a5b111e0b49b Mon Sep 17 00:00:00 2001 From: Rishabh Raghunath Date: Fri, 31 Jul 2020 22:19:18 +0530 Subject: [PATCH] Release 1.2.0 --- README.md | 73 +++++++++++++++++++++++++++---------------------------- 1 file changed, 36 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index b3b4466..ae00af4 100644 --- a/README.md +++ b/README.md @@ -1,51 +1,50 @@ -## Integrate React Native ZohoSalesIQ SDK: -Open your react-native project in the terminal and install the package using the commands as follows : +# react-native-zohosalesiq-mobilisten - - npm install react-native-zohosalesiq-mobilisten --save - - react-native link react-native-zohosalesiq-mobilisten +## Getting started -###### iOS Setup : +`$ npm install react-native-zohosalesiq-mobilisten --save` -Open **Podfile** inside the **ios** folder of your react native project. +### Automatic installation -If you don't have Podfile, run the following command from the ios folder : +`$ react-native link react-native-zohosalesiq-mobilisten` -``` -pod init -``` +### Manual installation -Include **ZohoSalesIQ React Native SDK** into your Podfile as follows : - -``` -target 'YourProjectName' do - -pod 'RNZohoSalesIQ', :path => '../node_modules/react-native-zohosalesiq-mobilisten/ios/RNZohoSalesIQ.podspec' - -end -``` +#### iOS -Run command **pod install** from the ios directory. +1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]` +2. Go to `node_modules` ➜ `react-native-zohosalesiq-mobilisten` and add `RNZohosalesiqMobilisten.xcodeproj` +3. In XCode, in the project navigator, select your project. Add `libRNZohosalesiqMobilisten.a` to your project's `Build Phases` ➜ `Link Binary With Libraries` +4. Run your project (`Cmd+R`)< -**Note :** -After a successful pod install, open the iOS project in Xcode and navigate to the **Build Settings > Build Options** and set **ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES** to **Yes** +#### Android -###### Android Setup : +1. Open up `android/app/src/main/java/[...]/MainActivity.java` + - Add `import com.reactlibrary.RNZohosalesiqMobilistenPackage;` to the imports at the top of the file + - Add `new RNZohosalesiqMobilistenPackage()` to the list returned by the `getPackages()` method +2. Append the following lines to `android/settings.gradle`: + ``` + include ':react-native-zohosalesiq-mobilisten' + project(':react-native-zohosalesiq-mobilisten').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-zohosalesiq-mobilisten/android') + ``` +3. Insert the following lines inside the dependencies block in `android/app/build.gradle`: + ``` + compile project(':react-native-zohosalesiq-mobilisten') + ``` -Open the android folder of your react-native project in Android Studio or any other platform for Android development. +## Usage +```javascript +import { ZohoSalesIQ } from 'react-native-zohosalesiq-mobilisten'; -Add the following maven repository in the project level build.gradle file. - -``` -allprojects { - repositories { - ..... - maven { url 'https://maven.zohodl.com' } - } +if (Platform.OS === 'ios'){ + ZohoSalesIQ.init("ios_app_key","ios_access_key"); + ZohoSalesIQ.setLauncherVisibility(true); + //By default, if you wish to display the chat button/bubble on the application, then use .setLauncherVisibility() API. +} +else{ + ZohoSalesIQ.init("android_app_key","android_access_key"); + ZohoSalesIQ.setLauncherVisibility(true); + //By default, if you wish to display the chat button/bubble on the application, then use .setLauncherVisibility() API. } ``` - -Then, press **Sync Now** in the bar that appears in the IDE. - - -Help Doc :- [ZohoSalesIQ ReactNative SDK](https://www.zoho.com/salesiq/help/developer-section/android-sdk-overview.html)