Giter VIP home page Giter VIP logo

react-native-zoom-us-sdk's Introduction

React Native zoom.us SDK

Implementation of native Android and iOS zoom.us SDK for React Native.

Getting started

1. Install native zoom.us SDK

This is an implementation of the native Android and iOS zoom.us SDK so before you start you need to install the native Android and iOS SDK first to your project.

Follow Zoom Developer Documentation to create a developer account and application.

Android

Follow Zoom Android SDK Documentation to install native Android SDK in your project.

iOS

Follow Zoom iOS SDK Documentation to just download the library and don't add it to project.

2. Install the library

using either Yarn:

$ yarn add https://github.com/EslamElMeniawy/react-native-zoom-us-sdk

or npm:

$ npm install --save https://github.com/EslamElMeniawy/react-native-zoom-us-sdk

3. Add native zoom.us iOS SDK

Move the iOS lib folder downloaded in first step to

projectDir/node_modules/react-native-zoom-us-sdk/ios

4. Link

  • React Native 0.60+

CLI autolink feature links the module while building the app.

  • React Native <= 0.59
$ react-native link react-native-zoom-us-sdk

Note For iOS using cocoapods, run:

$ cd ios/ && pod install

Usage

Import the library

import ZoomUsSdk from 'react-native-zoom-us-sdk';

Initialize Zoom SDK

try {
  const initializeResult = await ZoomUsSdk.initializeZoom(
    'SdkApiKey',
    'SdkApiSecret',
    'WebDomain',
  );

  console.log(initializeResult);
} catch (exception) {
  console.error('Error initialize zoom', exception);
}

Start Meeting

try {
  const startResult = await ZoomUsSdk.startMeeting(
    'JwtAccessToken',
    'ZoomToken',
    'ZoomAccessToken',
    'MeetingNnumber',
    'UserId',
    'DisplayName',
    // Meeting options.
    {
      autoConnectAudio: true,
      disableCallIn: true,
      disableCallOut: true,
      meetingInviteHidden: true,
      meetingShareHidden: true,
      meetingIdHidden: true,
      meetingPasswordHidden: true,
      meetingAudioHidden: true,
      meetingVideoHidden: true,
      meetingParticipantHidden: true,
      meetingMoreHidden: true,
    },
  );

  console.log(startResult);
} catch (exception) {
  if (exception.code === 'ERR_ZOOM_IN_MEETING') {
    // User already in a meeting.
    // You can either use ZoomUsSdk.returnToCurrentMeeting()
    // Or ZoomUsSdk.leaveCurrentMeeting()
    // Or let the user decide.
  } else {
    console.error('Error start meeting', exception);
  }
}

Join Meeting

try {
  const joinResult = await ZoomUsSdk.joinMeeting(
    'MeetingNnumber', // This value is returened in start meeting result.
    'MeetingPassword', // This value is returened in start meeting result.
    'DisplayName',
    // Meeting options.
    {
      autoConnectAudio: true,
      disableCallIn: true,
      disableCallOut: true,
      meetingInviteHidden: true,
      meetingShareHidden: true,
      meetingIdHidden: true,
      meetingPasswordHidden: true,
      meetingAudioHidden: true,
      meetingVideoHidden: true,
      meetingParticipantHidden: true,
      meetingMoreHidden: true,
    },
  );

  console.log(joinResult);
} catch (exception) {
  if (exception.code === 'ERR_ZOOM_IN_MEETING') {
    // User already in a meeting.
    // You can either use ZoomUsSdk.returnToCurrentMeeting()
    // Or ZoomUsSdk.leaveCurrentMeeting()
    // Or let the user decide.
  } else {
    console.error('Error join meeting', exception);
  }
}

Return To Current Meeting

try {
  const returnToMeetingResult = await ZoomUsSdk.returnToCurrentMeeting();
  console.log(returnToMeetingResult);
} catch (exception) {
  console.error('Error returning to current meeting', exception);
}

Leave Current Meeting

try {
  const leaveMeetingResult = await ZoomUsSdk.leaveCurrentMeeting();
  console.log(leaveMeetingResult);
} catch (exception) {
  console.error('Error leaving current meeting', exception);
}

Example

An example of usage of this library can be found at react-native-zoom-us-sdk-example.

react-native-zoom-us-sdk's People

Contributors

eslamelmeniawy avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.