react-native-zoom-us

React-native bridge for ZoomUs SDK

Usage no npm install needed!

<script type="module">
  import reactNativeZoomUs from 'https://cdn.skypack.dev/react-native-zoom-us';
</script>

README

react-native-zoom-us

This is a bridge for ZoomUS SDK:

Platform Version Url Changelog
iOS 5.9.1.2191 https://github.com/zoom/zoom-sdk-ios https://marketplace.zoom.us/docs/changelog#labels/client-sdk-i-os
Android 5.9.1.3674 https://github.com/zoom/zoom-sdk-android https://marketplace.zoom.us/docs/changelog#labels/client-sdk-android

Tested on XCode 13.2.1 and react-native 0.66.0. (See details)

Pull requests are welcome.

Getting started

$ npm install react-native-zoom-us

Installation

If you have react-native < 0.60, check Full Linking Guide

Android

  1. Set pickFirst rules in android/app/build.gradle
android {
    packagingOptions {
        pickFirst 'lib/arm64-v8a/libc++_shared.so'
        pickFirst 'lib/x86/libc++_shared.so'
        pickFirst 'lib/x86_64/libc++_shared.so'
        pickFirst 'lib/armeabi-v7a/libc++_shared.so'
    }
}
  1. In your MainApplication.java inside of onCreate add SoLoader.loadLibrary("zoom");:
@Override
  public void onCreate() {
    super.onCreate();
    SoLoader.init(this, /* native exopackage */ false);
    SoLoader.loadLibrary("zoom"); // <-- ADD THIS LINE
    initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
  }
  1. Add this to /android/app/src/main/res/xml/network_security_config.xml
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
  <domain-config cleartextTrafficPermitted="true">
    <domain includeSubdomains="true">ocsp.digicert.com</domain>
    <domain includeSubdomains="true">crl3.digicert.com</domain>
    <domain includeSubdomains="true">crl4.digicert.com</domain>
    <domain includeSubdomains="true">crl.godaddy.com</domain>
    <domain includeSubdomains="true">certificates.godaddy.com</domain>
    <domain includeSubdomains="true">crl.starfieldtech.com</domain>
    <domain includeSubdomains="true">certificates.starfieldtech.com</domain>
    <domain includeSubdomains="true">ocsp.godaddy.com</domain>
    <domain includeSubdomains="true">ocsp.starfieldtech.com</domain>
  </domain-config>
</network-security-config>

Then add this to /android/app/src/main/AndroidManifest.xml

<application
  ...

  android:networkSecurityConfig="@xml/network_security_config"
>
  1. Add this to /android/app/src/debug/res/xml/network_security_config.xml
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
  <!-- deny cleartext traffic for React Native packager ips in release -->
  <domain-config cleartextTrafficPermitted="true">
    <domain includeSubdomains="true">localhost</domain>
    <domain includeSubdomains="true">10.0.2.2</domain>
    <domain includeSubdomains="true">10.0.3.2</domain>
  </domain-config>
</network-security-config>

Then add this to /android/app/src/debug/AndroidManifest.xml

<application
  ...

  tools:replace="android:usesCleartextTraffic"
  android:networkSecurityConfig="@xml/network_security_config"
>

iOS

  1. Make sure you have appropriate description in Info.plist:
<key>NSBluetoothPeripheralUsageDescription</key>
<string>We will use your Bluetooth to access your Bluetooth headphones.</string>
    
<key>NSCameraUsageDescription</key>
<string>For people to see you during meetings, we need access to your camera.</string>
    
<key>NSMicrophoneUsageDescription</key>
<string>For people to hear you during meetings, we need access to your microphone.</string>
    
<key>NSPhotoLibraryUsageDescription</key>
<string>For people to share, we need access to your photos.</string>
  1. Update pods using cd ios/ && pod install && cd ..

  2. Make sure to set ENABLE_BITCODE = NO; for both Debug and Release because bitcode is not supported by Zoom iOS SDK

  3. Optional: Implement custom UI See docs for more details.

Usage

import ZoomUs from 'react-native-zoom-us';

// initialize minimal
await ZoomUs.initialize({
  clientKey: '...',
  clientSecret: '...',
})

// initialize using JWT
await ZoomUs.initialize({
  jwtToken: '...',
})

// initialize with extra config
await ZoomUs.initialize({
  clientKey: '...',
  clientSecret: '...',
  domain: 'zoom.us'
}, {
  disableShowVideoPreviewWhenJoinMeeting: true,
  enableCustomizedMeetingUI: true
})


// Start Meeting
await ZoomUs.startMeeting({
  userName: 'Johny',
  meetingNumber: '12345678',
  userId: 'our-identifier',
  zoomAccessToken: zak,
  userType: 2, // optional
})


// Join Meeting
await ZoomUs.joinMeeting({
  userName: 'Johny',
  meetingNumber: '12345678',
})

// Join Meeting with extra params
await ZoomUs.joinMeeting({
  userName: 'Johny',
  meetingNumber: '12345678',
  password: '1234',
  noAudio: true,
  noVideo: true,
})

// Leave Meeting
await ZoomUs.leaveMeeting()

// Connect Audio
await ZoomUs.connectAudio()
// you can also use autoConnectAudio: true in `ZoomUs.joinMeeting`

Docs

Testing

The plugin has been tested for joinMeeting using smoke test procedure:

  • react-native-zoom-us: 6.5.1
  • react-native: 0.66.0
  • node: 14.16.0
  • macOS: 10.15.5
  • XCode: 12.4
  • android minSdkVersion: 21

FAQ

Does library support Expo?

You have to eject your expo project to use this library.