zoom / videosdk-reactnative-quickstart

This is a sample application that demonstrates how to use the Zoom Video SDK in a React Native application.
6 stars 4 forks source link

Zoom VideoSDK React Native Demo

Use of this sample app is subject to our Terms of Use.

This is a sample application that demonstrates how to use the Zoom Video SDK in a React Native application. Built with Expo.

Prerequisites

Getting Started

  1. Clone the Repo
git clone https://github.com/zoom/VideoSDK-ReactNative-Quickstart.git
  1. Install the dependencies
yarn
  1. Install cocoapods (iOS only)
npx pod-install ## (or) cd ios && pod install
  1. Add your Zoom Video SDK credentials

Disclaimer: It's not recommended to store your credentials in the source code. This is only for demonstration purposes for sake of simplicity. You should use a secure backend to generate the token and pass it to the client.

  1. Run the app
yarn ios
# or
yarn android

How to setup in a fresh project

  1. Create a new project, we recommend using Expo to simplify the setup
yarn create expo zoom-video-sdk --template # select Blank (Typescript)
# or
npx react-native@latest init zoomRNCli --template react-native-template-typescript
  1. Install the Zoom Video SDK
yarn add @zoom/react-native-videosdk
  1. Add permissions for the camera and microphone
{
  "expo": {
    "android": {
      "permissions": ["CAMERA", "RECORD_AUDIO"]
    },
    "ios": {
      "infoPlist": {
        "NSCameraUsageDescription": "Text",
        "NSMicrophoneUsageDescription": "Text"
      }
    }
  }
}

If you're not using Expo:

  1. Wrap your app in the ZoomVideoSdkProvider
function App() {
  ...
  return (
    <ZoomVideoSdkProvider config={{....}}>
      <YourApp>
    </ZoomVideoSdkProvider>
  );
  1. Use the Zoom Video SDK
function YourApp() {
  const zoom = useZoom();
  const handleJoin = async () => {
     await zoom.joinSession({....});
  }
  ...
  1. Scaffold the native code (Skip if not using Expo)
npx expo prebuild
  1. Run the app
npx expo run:ios
# or
npx expo run:android
npm run android
# or
npm run ios

Need help?

If you're looking for help, try Developer Support or our Developer Forum. Priority support is also available with Premier Developer Support plans.