@supsis/visitor-rn
v1.2.0
Published
This is a React Native component to easily add Supsis Visitor screen to your application.
Downloads
236
Readme
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
Example:
supsisRef.current?.setUserData({
email: "[email protected]",
});
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!