Skip to content

Latest commit

 

History

History
66 lines (53 loc) · 1.62 KB

Readme.md

File metadata and controls

66 lines (53 loc) · 1.62 KB



React Native Freshchat

Overview

  1. Installation
  2. Setup
  3. Running

1. Installation

Clone react native freshchat

git clone https://github.com/fachrinfl/react-native-freshchat.git
cd react-native-freshchat

2. Setup

Before run the project setup the library

  1. Download library in react-native-freshchat-sdk
  2. Extract react-native-freshchat-sdk and place it inside node_module folder in your project
  3. Add "react-native-freshchat-sdk": "^0.4.0" under dependencies in project package.json
  4. Run react-native link on you project root directory

Add Manually react-native-freshchat-sdk in Android

  • in android/settings.gradle
...
include ':react-native-freshchat-sdk'
project(':react-native-freshchat-sdk').projectDir = new File(settingsDir, '../node_modules/react-native-freshchat-sdk/android')
  • in android/app/build.gradle add:
dependencies {
    ...
    compile project(':react-native-freshchat-sdk')
}
  • and finally, in android/src/main/java/com/{YOUR_APP_NAME}/MainApplication.java
//...
import com.freshchat.consumer.sdk.react.RNFreshchatSdkPackage; // <--- This!
//...
@Override
protected List<ReactPackage> getPackages() {
  return Arrays.<ReactPackage>asList(
    new MainReactPackage(),
    new RNFreshchatSdkPackage() // <---- and This!
  );
}

3. Running

react-native run-android