Clone react native freshchat
git clone https://github.com/fachrinfl/react-native-freshchat.git
cd react-native-freshchat
Before run the project setup the library
- Download library in
react-native-freshchat-sdk
- Extract react-native-freshchat-sdk and place it inside node_module folder in your project
- Add "react-native-freshchat-sdk": "^0.4.0" under dependencies in project package.json
- 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!
);
}
react-native run-android