From 6233bd4ecd91b0a50241bb9bac8619e63e16f1d4 Mon Sep 17 00:00:00 2001 From: Kasiviswanath Senthilkumar Date: Mon, 12 Feb 2024 18:32:31 +0530 Subject: [PATCH] Release v8.0.5 Release v8.0.5 --- README.md | 92 +++++++++++++++++++++++++----- components/zohosalesiqJSWrapper.js | 2 +- package.json | 2 +- 3 files changed, 79 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index faf1da4..e7ad509 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![SupportedLanguages](https://img.shields.io/badge/Platforms-iOS%20%7C%20%20Android-green.svg)](https://www.zoho.com/salesiq/help/developer-section/react-native-sdk-installation.html) [![Version](https://img.shields.io/badge/version-8.0.4-blue.svg)](https://mobilisten.io/) [![Mobilisten NPM CD](https://github.com/zoho/SalesIQ-Mobilisten-ReactNative/workflows/Mobilisten%20NPM%20CD/badge.svg)](https://github.com/zoho/SalesIQ-Mobilisten-ReactNative/actions) +[![SupportedLanguages](https://img.shields.io/badge/Platforms-iOS%20%7C%20%20Android-green.svg)](https://www.zoho.com/salesiq/help/developer-section/react-native-sdk-installation.html) [![Version](https://img.shields.io/badge/version-8.0.5-blue.svg)](https://mobilisten.io/) [![Mobilisten NPM CD](https://github.com/zoho/SalesIQ-Mobilisten-ReactNative/workflows/Mobilisten%20NPM%20CD/badge.svg)](https://github.com/zoho/SalesIQ-Mobilisten-ReactNative/actions) # React Native module for SalesIQ Mobilisten SDK @@ -28,42 +28,104 @@ react-native link react-native-zohosalesiq-mobilisten #### Installation steps for iOS -1. Navigate to the **ios** folder in the project directory and open **Podfile**. -Add the "**/ios**" to the path for the **RNZohoSalesIQ** pod as shown below. +1. Navigate to the `ios` folder in the project directory and open **Podfile**. + Add the "**/ios**" to the path for the `RNZohoSalesIQ` pod as shown below. + ```diff - pod 'RNZohoSalesIQ', :path => '../node_modules/react-native-zohosalesiq-mobilisten' + pod 'RNZohoSalesIQ', :path => '../node_modules/react-native-zohosalesiq-mobilisten/ios' ``` -2. Run the `pod repo update && pod install` command from the **ios** directory. +2. Run the `pod repo update && pod install` command from the `ios` directory. #### Installation steps for Android -1. Navigate to the **android** folder within the project directory using Android Studio or any other platform of choice for Android development. -Add the following maven repository to the **build.gradle** file. -```ruby +1. If you're using React Native v0.60 or above, the dependency will be linked automatically without + any steps being taken. + +#### Android: Auto linking with React Native v0.59 and below + +``` +$ react-native link react-native-zohosalesiq-mobilisten +``` + +#### Android: Manual linking with React Native v0.59 and below + +- Add the below code to the `android/settings.gradle` + +```Gradle +include ':react-native-zohosalesiq-mobilisten' +project(':react-native-zohosalesiq-mobilisten').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-zohosalesiq-mobilisten/android') +``` + +- Implement the dependency in the `android/app/build.gradle` file inside `dependencies` + +```Gradle +implementation project(':react-native-zohosalesiq-mobilisten') +``` + +- Add the below snippet to `android/app/src/main/java/com/module_name/MainApplication.java` if the + packages were not auto-generated. + +```java +private final ReactNativeHost mReactNativeHost=new ReactNativeHost(this){ +// ... +@Override +protected List getPackages(){ + // Add new RNZohoSalesIQPackage() into the React packages list like below + return new ArrayList<>(Arrays.asList(new RNZohoSalesIQPackage())); + } + // ... + }; + +@Override +public ReactNativeHost getReactNativeHost(){ + return mReactNativeHost; + } +``` + +2. Navigate to the `android` folder within the project directory using Android Studio or any other + platform of choice for Android development. + Add the following maven repository to the `build.gradle` file. + +```Gradle allprojects { repositories { - ..... + // ... maven { url 'https://maven.zohodl.com' } } } ``` -2. Click **Sync Now** from the toolbar on the IDE. + +3. Click `Sync Now` from the toolbar on the IDE. ## Initializing Mobilisten + 1. Generate `App` and `Access` keys for iOS and Android platforms by providing your bundle id. -2. Use the **ZohoSalesIQ.init** API with keys for each platform as shown below. +2. Use the `ZohoSalesIQ.initWithCallback` API with keys for each platform as shown below. + ```js import { ZohoSalesIQ } from 'react-native-zohosalesiq-mobilisten'; -if (Platform.OS === 'ios'){ - ZohoSalesIQ.init("ios_app_key","ios_access_key"); -}else{ - ZohoSalesIQ.init("android_app_key","android_access_key"); +let appKey; +let accessKey; + +if (Platform.OS === 'ios') { + appKey = "ios_app_key"; + accessKey = "ios_access_key"; +} else { + appKey = "android_app_key"; + accessKey = "android_access_key"; } + +ZohoSalesIQ.initWithCallback(appKey, accessKey, success => { + // Your code +}); ``` -3. If you wish to show the default chat launcher, use the [**ZohoSalesIQ.Launcher.show()**](https://www.zoho.com/salesiq/help/developer-section/react-native-sdk-launcher-show.html) API (Optional). + +3. If you want to show the default chat launcher, use the [**ZohoSalesIQ.Launcher.show() + **](https://www.zoho.com/salesiq/help/developer-section/react-native-sdk-launcher-show.html) + API (Optional). ## API Documentation You can find the list of all APIs and their documentation [here](https://www.zoho.com/salesiq/help/developer-section/react-native-sdk-add-event-listener.html) under the **API Reference** section. diff --git a/components/zohosalesiqJSWrapper.js b/components/zohosalesiqJSWrapper.js index f8f8e5d..0e9c58c 100644 --- a/components/zohosalesiqJSWrapper.js +++ b/components/zohosalesiqJSWrapper.js @@ -1,4 +1,4 @@ -const { NativeModules, Dimensions } = require('react-native'); //No I18N +const { NativeModules, Dimensions, Platform } = require('react-native'); //No I18N const { RNZohoSalesIQ } = NativeModules; import { NativeEventEmitter } from 'react-native'; //No I18N const emitter = new NativeEventEmitter(RNZohoSalesIQ); diff --git a/package.json b/package.json index eed45e7..d554deb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-zohosalesiq-mobilisten", - "version": "8.0.4", + "version": "8.0.5", "description": "A React Native module for the ZohoSalesIQ Mobilisten SDK", "bugs": { "email": "support@zohosalesiq.com"