This is a React Native component to easily add Supsis Visitor screen to your application.
npm install @supsis/visitor-rn react-native-webview@^13.6.4
or
yarn add @supsis/visitor-rn react-native-webview@^13.6.4
- 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.
import { RefsInterface, SupsisVisitor } from "@supsis/visitor-rn";
// ...
const supsisRef = useRef < RefsInterface > null;
return (
<Container>
<SupsisVisitor ref={supsisRef} domainName={"DOMAIN_NAME"} />
</Container>
);
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",
});
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>
);
If you need any help, you can chat with us here.
I hope you will find this module useful. Happy coding!