Freshchat library for React native. Currently it supports android only.
1 - Install
npm install --save react-native-android-library-freshchat-sdk
2 - In settings.gradle file
include ':react-native-android-library-freshchat-sdk'
project(':react-native-android-library-freshchat-sdk').projectDir = new File(settingsDir, '../node_modules/react-native-android-library-freshchat-sdk/android')
3 - In build.gradle(app)
compile project(':react-native-android-library-freshchat-sdk')
compile 'com.github.freshdesk:freshchat-android:1.0.0'
4 - In build.gradle(project)
allprojects {
repositories {
mavenLocal()
jcenter()
maven {
maven { url "https://jitpack.io" }
}
}
}
5 - add this in your MainApplication package list.
new FreshChatReactPackage()
6 - Finally import library
import FreshChatSdk from 'react-native-android-library-freshchat-sdk'
7 - For initializing
FreshChatSdk.initWithUser(appId,appkey,user unique id,firstname,lastname,email,mobile,country code);
FreshChatSdk.init(appId,appkey)
8 - For calling faqs
FreshChatSdk.showFAQs()
9 - For calling conversations
FreshChatSdk.showConversations(null)
10 - For calling conversations
FreshChatSdk.showConversations("ENTER_YOUR_TAG_HERE")
11 - For reseting user
FreshChatSdk.resetUser()