@kustomer/chat-react-native

2.1.1 • Public • Published

Kustomer Chat React Native SDK

Embed Kustomer in your own products with our chat SDK for React Native.


Installation

yarn add @kustomer/chat-react-native

setup steps

iOS support

cd ios
pod update
pod install

Android Support

Due to potential late init issues, we recommend initialization through your MainApplication.java/kt

edit android/app/src/main/java/com/push_notifications/MainApplication.kt

public void onCreate() {
  // ...
  KustomerChat.configure(apiKey, options);
}

HOWTO INSTALL

The default way to configure the SDK is through in your app's js bundle. Here is an example app with README explaining how to configure the app to securely import your API key.

import KustomerChat from '@kustomer/chat-react-native';

if(platform.ios) {
  // Ensure configure runs only once. Tested with `useEffect`. see example above.
  KustomerChat.configure(apiKey, options);
}

Permissions iOS

Add the following to your Info.plist for file upload support:

Privacy - Camera Usage Description
Privacy - Media Library Usage Description
Privacy - Microphone Usage Description
Privacy - Photo Library Usage Description

Authentication

For auth setup, see the iOS docs

Open a conversation dialog

import KustomerChat from '@kustomer/chat-react-native';

KustomerChat.show(KustomerDisplayMode); // KustomerDisplayMode is an optional enum param

Custom colors

For Android, see the Android docs For iOS, see the iOS docs

We are working on a way to customize colors in JS/TS sources, once, but it is currently not possible with the native SDKs.

License

You can view the license here

Notes

WIP: Most of the APIs are stable, and no major changes are expected in the way the SDK works.

Push notifications

iOS

  • should request permission using another lib, like react-native-permissions or react-native-push-notification or react-native-firebase
  • check the iOS docs for Push Keys and Certificates and Push Notifications and modify your AppDelegate.m accordingly.

ℹ️ Note: this will likely match android's behavior in the future

Android

  • use a PN library (like react-native-firebase), and call setPushToken once a token is received.
  • call KustomerChat.onRemoteMessage in your onRemoteMessage callback. You can use isKustomerNotification to check if the message is from Kustomer, and should be forwarded.

Package Sidebar

Install

npm i @kustomer/chat-react-native

Weekly Downloads

611

Version

2.1.1

License

SEE LICENSE AT https://www.kustomer.com/legal/supplemental-terms/

Unpacked Size

295 kB

Total Files

231

Last publish

Collaborators

  • tomloake-kustomer
  • noahkustomer
  • davidwright15
  • kustomerjgish
  • lee_kustomer
  • chris-breen-kustomer
  • jkelly23
  • hankthemason-kustomer
  • jcguardino-kustomer
  • jacob.hansen
  • kbajzekkustomer
  • snoah-kustomer
  • ayedl
  • wwangkustomer
  • pcasonkustomer
  • tedyu
  • venkykust
  • emre.ozsahin
  • akhan-kustomer
  • sbkustomer
  • simon-tang
  • raymondjoneskustomer
  • sunnia-kustomer
  • parodco
  • quincy88
  • lindseywells
  • breencf
  • kirk.gordon
  • kustdpars
  • mikeblake
  • sudharshan-natarajan
  • michael.iacono
  • monty-kustomer
  • mariavolpe15
  • wilsonwongkustomer.com
  • jeremykustomer
  • kustomerbot
  • frazerkustomer
  • itsnyd3ll
  • ddruker
  • bradbirnbaum
  • peterj0hnson
  • oscarbrennwald
  • benmccormick_kust
  • bortojac
  • traycooper
  • chrisgbaker
  • maks.suski
  • patrickkng
  • drewsapolnick
  • victor.peinado
  • donovantaitt
  • calebkustomer
  • nicholai.main
  • pocho23