react-native-zoom-us-reaction v2.1.0
react-native-zoom-us
This is a minimum bridge of https://github.com/zoom/zoom-sdk-android and https://github.com/zoom/zoom-sdk-ios
Tested on XCode 9.4.1 and node 10.14.1.
Pull requests are welcome.
Getting started
$ npm install react-native-zoom-us
Mostly automatic installation
$ react-native link react-native-zoom-us
Extra steps for Android
Since Zoom SDK *.aar libraries are not globally distributed
it is also required to manually go to your project's android/build.gradle and under allprojects.repositories add the following:
allprojects {
repositories {
flatDir {
dirs "$rootDir/../node_modules/react-native-zoom-us/android/libs"
}
...
}
...
}If you have problem with multiDex go to your project's android/app/build.gradle and under android.defaultSettings add the following:
android {
defaultConfig {
multiDexEnabled true
...
}
...
}Note: In android/app/build.gradle I tried to set up compile project(':react-native-zoom-us') with transitive=false
and it compiled well, but the app then crashes after running with initialize/meeting listener.
So the above solution seems to be the best for now.
Extra steps for iOS
- In XCode, in your main project go to
Generaltab, expandLinked Frameworks and Librariesand add the following libraries:
libsqlite3.tbdlibstdc++.6.0.9.tbdlibz.1.2.5.tbd
- In XCode, in your main project go to
Generaltab, expandLinked Frameworks and Librariesand addMobileRTC.framework:
- choose
Add other... - navigate to
../node_modules/react-native-zoom-us/ios/libs - choose
MobileRTC.framework
In XCode, in your main project go to
Generaltab, expandEmbedded Binariesand addMobileRTC.frameworkfrom the list - should be atFrameworks.In XCode, in your main project go to
Build Phasestab, expandCopy Bundle Resourcesand addMobileRTCResources.bundle:
- choose
Add other... - navigate to
../node_modules/react-native-zoom-us/ios/libs - choose
MobileRTCResources.bundle - choose
Create folder referencesand uncheckCopy files if neededNote: if you do not haveCopy Bundle Resourcesyou can add it by clicking on top-left+sign
- In XCode, in your main project go to
Build Settingstab:
- search for
Enable Bitcodeand make sure it is set toNO - search for
Framework Search Pathsand add$(SRCROOT)/../node_modules/react-native-zoom-us/ios/libswithnon-recursive
- In XCode, in your main project go to
Infotab and add the following keys with appropriate description:
NSCameraUsageDescriptionNSMicrophoneUsageDescriptionNSPhotoLibraryUsageDescription
- Because this package includes Zoom SDK that works for both simulator and real device, when releasing to app store you may encounter problem with unsupported architecure. Please follow this answer to add script in
Build Phasesthat filters out unsupported architectures: https://stackoverflow.com/questions/30547283/submit-to-app-store-issues-unsupported-architecture-x86. You may want to modify the script to be more specific, i.e. replace'*.framework'with'MobileRTC.framework'.
Manual installation
iOS
- In XCode, in the project navigator, right click
Libraries➜Add Files to [your project's name] - Go to
node_modules➜react-native-zoom-usand addRNZoomUs.xcodeproj - In XCode, in the project navigator, select your project. Add
libRNZoomUs.ato your project'sBuild Phases➜Link Binary With Libraries - Run your project (
Cmd+R)< - Follow Mostly automatic installation-> Extra steps for iOS
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import ch.milosz.reactnative.RNZoomUsPackage;to the imports at the top of the file - Add
new RNZoomUsPackage()to the list returned by thegetPackages()method
- Append the following lines to
android/settings.gradle:include ':react-native-zoom-us' project(':react-native-zoom-us').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-zoom-us/android') - Insert the following lines inside the dependencies block in
android/app/build.gradle:compile project(':react-native-zoom-us') - Follow Mostly automatic installation-> Extra steps for Android
Usage
import ZoomUs from 'react-native-zoom-us';
await ZoomUs.initialize(
config.zoom.appKey,
config.zoom.appSecret,
config.zoom.domain
);
// Start Meeting
await ZoomUs.startMeeting(
displayName,
meetingNo,
userId, // can be 'null'?
userType, // for pro user use 2
zoomAccessToken, // zak token
zoomToken // can be 'null'?
// NOTE: userId, userType, zoomToken should be taken from user hosting this meeting (not sure why it is required)
// But it works with putting only zoomAccessToken
);
// OR Join Meeting
await ZoomUs.joinMeeting(
displayName,
meetingNo
);See demo usage of this library: https://github.com/mieszko4/react-native-zoom-us-test