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,
PubNubSwift
is a dependency ofKustomerChat
and needs itsbuild_type
overridden tostatic_framework
in order to build properly.You can do this using
react-native-podfix
which is a dependency of this package.This runs a
postinstall
script, that will patch thePodfile
of your project, and adds apost_install
hook that will override thebuild_type
ofPubNubSwift
.You should not have to do anything else, just remember why that
fix_pods
call 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 1 year ago