@supsis/visitor-rn
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

Supsis Visitor

This is a React Native component to easily add Supsis Visitor screen to your application.

Installation

npm install @supsis/visitor-rn react-native-webview@^13.6.4

or

yarn add @supsis/visitor-rn react-native-webview@^13.6.4

Prerequisites

  • iOS - To enable camera and microphone access in your app, add the following keys to your Info.plist file:
<key>NSCameraUsageDescription</key>
<string>Camera access is required for live video calls</string>
<key>NSMicrophoneUsageDescription</key>
<string>Microphone access is required for live video calls</string>
  • Android - Add the following permissions to your AndroidManifest.xml file:
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />

To use SupsisVisitor in your React application, you will need the Supsis license ID.

  • domainName - Defines the name of your application
  • For instance , namespace - mycompany - for mycompany.supsis.live If you don't have an account, you can create one here.

Usage

import { RefsInterface, SupsisVisitor } from "@supsis/visitor-rn";

// ...

const supsisRef = useRef < RefsInterface > null;

return (
	<Container>
		<SupsisVisitor ref={supsisRef} domainName={"DOMAIN_NAME"} />
	</Container>
);

Commands for refs

open makes visible supsis
close makes invisible supsis
setUserData fills login form
setDepartment allows you to pick a department
setContactProperty fills contact properties
clearCache clear visitor data

Example:

supsisRef.current?.setUserData({
	email: "John@doe.com",
});

Visitor Connected & Destroyed Chat

import { RefsInterface, SupsisVisitor } from "@supsis/visitor-rn";

const supsisRef = useRef < RefsInterface > null;

const onDisconnected: void = () => {
	console.log("Visitor Disconnected from Chat!");
};

const onConnected: void = () => {
	console.log("Visitor Disconnected from Chat!");
};

return (
	<Container>
		<SupsisVisitor
			ref={supsisRef}
			domainName={"DOMAIN_NAME"}
			onDisconnected={onDisconnected}
			onConnected={onConnected}
		/>
	</Container>
);

Support

If you need any help, you can chat with us here.

I hope you will find this module useful. Happy coding!

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @supsis/visitor-rn

Weekly Downloads

173

Version

1.2.0

License

MIT

Unpacked Size

12.5 kB

Total Files

15

Last publish

Collaborators

  • soulflyy
  • softcand