SaleAssist for Developers
HomeDashboardAPI DocsBook A Demo
  • 👋Welcome
  • Introduction
  • Onboarding Steps
  • Admin Account Creation
  • Getting Started
  • Features Overview
    • Live Video Calling
      • Outbound Calls
        • Schedule Video Meets
        • Instant Video Meets
      • Inbound Calls
        • How to use ?
        • Integration
        • Desktop Call Management
    • Live Stream Selling
      • How to go Live?
      • Get RTMP and Stream Key from social channels.
    • Shoppable Videos Tiles
      • How to use?
      • Integration
    • Strike
      • AI Videos
    • Co-Browsing
  • Integration Guide
    • Mobile SDK integration
      • Cobrowse - Flutter SDK
      • React Native SDK
      • IOS SDK
      • Android SDK
      • How to delete my account?
      • Cobrowse - Android SDK
      • Cobrowse - IOS SDK
      • Identify your devices for Cobrowse
      • Use 6-digit codes
      • Redact sensitive data
      • Start and Stop Cobrowsing
      • Listening for events
    • User Experience
    • Agent Mapping
    • Nudges
    • Agent Feedback
    • AI Chat (Add Context)
    • API Integration
    • Webhook Integration
    • FAQ & Troubleshooting
    • Lead Management
    • Task Management
    • SaleAssist Whatsapp Feature
    • Sales/Conversion Tracking - Widget
    • Sales/Conversion Tracking - Video Tiles
    • Integrate meetings lite dashboard
  • Assets Managment
    • Media
    • Products
    • Orders
  • Organization Settings
    • Profile
    • Organization
    • Users & Roles
    • SMTP Integration
    • Custom Domain
    • Notification Manager
  • Addons
    • Transcription & Summarization
    • Video QR Codes
    • Video Emails
    • Live Chat
    • Outbound Phone Calling
    • Book In-store appointment
    • Schedule Call
    • Shoppable Video Links
      • How to use?
      • Integration
    • Video FAQs
      • How to use?
      • Integration
    • WhatsApp Onboarding steps
  • Analytics
    • Widget Insights
    • Video tiles insights
    • Reporting
    • SaleAssist Mobile Application
    • How to manage calls on Mobile Application
    • Admin Controls
  • Troubleshooting
    • Troubleshoot Video Call Permissions
  • Release Logs
    • v24.11.24
    • v24.11.30
    • v24.12.10
    • v25.01.10
    • v25.01.18
    • v25.01.29
    • v25.02.05
    • v25.02.05
Powered by GitBook
On this page

Was this helpful?

  1. Integration Guide
  2. Mobile SDK integration

React Native SDK

This document assumes that you understand the basic terms of React Native App development

PreviousCobrowse - Flutter SDKNextIOS SDK

Last updated 8 months ago

Was this helpful?

Step 1 : Install react-native-video package

Using npm:

npm i react-native-video --save

Using yarn:

yarn add react-native-video

Documentation link:

Step 2 : Add video tag to Main.js or App.js

Code Sample:

import React, {useEffect, useState} from 'react';
import Video from 'react-native-video';
import {
  SafeAreaView,
  Platform,
  StatusBar,
  StyleSheet,
  Text,
  useColorScheme,
  View,
} from 'react-native';

import {Colors} from 'react-native/Libraries/NewAppScreen';
function Main({navigation}) {
  const isDarkMode = useColorScheme() === 'dark';

  const backgroundStyle = {
    backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
  };

  const [isVisible, setIsVisible] = useState(false);

  useEffect(() => {
    const interval = setInterval(() => {
      setIsVisible(true);
      setTimeout(() => {
        setIsVisible(false);
      }, 5000);
    }, 10000);
    return () => clearInterval(interval);
  }, []);

  return (
    <SafeAreaView style={backgroundStyle}>
      <StatusBar
        barStyle={isDarkMode ? 'light-content' : 'dark-content'}
        backgroundColor={backgroundStyle.backgroundColor}
      />
      <View style={styles.container}>
        <View style={styles.content}>
          <Text>Content</Text>
        </View>
        <View style={styles.widgetContainer}>
          {isVisible && (
            <View style={styles.textContainer}>
              <Text style={styles.overlayText}>Tap to Navigate</Text>
            </View>
          )}
          <View
            style={styles.videoContainer}
            onStartShouldSetResponder={() => navigation.navigate('WebPage')}>
            <Video source={{
                uri: 'https://client-static.saleassist.ai/2953b7d7-fdf5-4cfd-b4e1-5808863a5f74/VAISHNAVIRAOEDIT-HV.mp4',
              }}
              ref={ref => {
                this.player = ref;
              }}
              muted={true}
              style={styles.video}
              onBuffer={this.onBuffer}
              onError={this.videoError}
              resizeMode={'cover'}
            />
          </View>
        </View>
      </View>
    </SafeAreaView>
  );
}

const styles = StyleSheet.create({
  container: {
    flexDirection: 'column',
    height: '100%',
  },
  content: {
    flex: 1,
    backgroundColor: 'white',
    justifyContent: 'center',
    alignItems: 'center',
  },
  videoContainer: {
    borderRadius: 100,
    height: 100,
    width: 100,
    backgroundColor: 'white',
    overflow: 'hidden',
    marginLeft: 'auto',
  },
  widgetContainer: {
    bottom: 10,
    right: 10,
    position: 'absolute',
    overflow: 'hidden',
  },
  video: {
    width: '100%',
    height: '100%',
  },
  overlayText: {
    fontSize: 11,
  },
  textContainer: {
    padding: 10,
    margin: 10,
    backgroundColor: 'white',
    borderRadius: 10,
    ...Platform.select({
      ios: {
        shadowColor: '#000',
        shadowOffset: {width: 0, height: 2},
        shadowOpacity: 0.5,
        shadowRadius: 4,
      },
      android: {
        elevation: 4,
      },
    }),
  },
});

export default Main;

Step 3 : Install react-native-webview Package

Using npm:

npm i react-native-webview --save

Using yarn:

yarn add react-native-webview

Documentation link:

Step 4 : Create WebPage.js

Code Sample:

import React from 'react';
import {WebView} from 'react-native-webview';
import {
  SafeAreaView,
  StatusBar,
  StyleSheet,
  useColorScheme,
  View,
} from 'react-native';

import {Colors} from 'react-native/Libraries/NewAppScreen';

function WebPage({navigation}) {
  const isDarkMode = useColorScheme() === 'dark';

  const backgroundStyle = {
    backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
  };

  return (
    <SafeAreaView style={backgroundStyle}>
      <StatusBar
        barStyle={isDarkMode ? 'light-content' : 'dark-content'}
        backgroundColor={backgroundStyle.backgroundColor}
      />
      <View style={styles.container}>
        <WebView
          source={{
            uri: 'https://jump-stg.saleassist.ai/source/1759ad2b-9059-4f74-ba1b-41c123493666?open=true',
          }}
          style={{flex: 1}}
        />
        </View>
    </SafeAreaView>
  );
}

const styles = StyleSheet.create({
  container: {
    flexDirection: 'column',
    height: '100%',
  },
});

export default WebPage;
npm: react-native-videonpm
npm: react-native-webviewnpm
Logo
Logo