Installation
An installation guide for the Kustomer Chat React Native SDK.
This guide covers how to install the Chat React Native SDK. For a quick start guide, see Quick start: Chat React Native SDK.
Prerequisites
See Requirements.
Install the SDK
To install the Kustomer Chat React Native SDK, run the following command:
npm install @kustomer/chat-react-native
or
yarn add @kustomer/chat-react-native
then you can install the iOS native dependencies by running:
cd ios && pod install
or
npx pod-install
Note for iOS
On iOS,
PubNubSwiftis a dependency ofKustomerChatand needs itsbuild_typeoverridden tostatic_frameworkin order to build properly.You can do this using
react-native-podfixwhich is a dependency of this package.This runs a
postinstallscript, that will patch thePodfileof your project, and adds apost_installhook that will override thebuild_typeofPubNubSwift.You should not have to do anything else, just remember why that
fix_podscall is in yourPodfile.
Allow file uploads
iOS
To allow customers to upload files through chat, in Xcode add privacy descriptions to your Info.plist file for the user's camera roll, media library, and local documents:
<key>NSPhotoLibraryUsageDescription</key>
<string>Allow access to your photo library to send to Support</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Allow access to your photo library to send to Support</string>
<key>NSCameraUsageDescription</key>
<string>Allow access to your camera to send to Support</string>
<key>NSMicrophoneUsageDescription</key>
<string>Allow access to your microphone to send to Support</string>
<key>NSAppleMusicUsageDescription</key>
<string>Allow access to your music library to send to Support</string>
Android
By default, KustomerChat lists the CAMERA permission in its manifest. That can be removed by passing the tools:node="remove" attribute in your AndroidManifest.xml file:
<uses-permission android:name="android.permission.CAMERA" tools:node="remove" />
ProGuard
The package includes a proguard-rules.pro file n the android folder. If you encounter any issues, see the Proguard rules section of our Android documentation to add the rules manually.
Updated over 2 years ago