This is a minimum bridge of https://github.com/zoom/zoom-sdk-android and https://github.com/zoom/zoom-sdk-ios
Tested on XCode 11.3.1 and node 13.8.0.
Pull requests are welcome.
$ npm install react-native-zoom-us
$ react-native link react-native-zoom-us
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.
- In XCode, in your main project go to
General
tab, expandLinked Frameworks and Libraries
and add the following libraries:
libsqlite3.tbd
libc++.tbd
libz.1.2.5.tbd
- In XCode, in your main project go to
General
tab, expandLinked Frameworks and Libraries
and 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
General
tab, expandEmbedded Binaries
and addMobileRTC.framework
from the list - should be atFrameworks
. -
In XCode, in your main project go to
Build Phases
tab, expandCopy Bundle Resources
and addMobileRTCResources.bundle
:
- choose
Add other...
- navigate to
../node_modules/react-native-zoom-us/ios/libs
- choose
MobileRTCResources.bundle
- choose
Create folder references
and uncheckCopy files if needed
Note: if you do not haveCopy Bundle Resources
you can add it by clicking on top-left+
sign
- In XCode, in your main project go to
Build Settings
tab:
- search for
Enable Bitcode
and make sure it is set toNO
- search for
Framework Search Paths
and add$(SRCROOT)/../node_modules/react-native-zoom-us/ios/libs
withnon-recursive
- In XCode, in your main project go to
Info
tab and add the following keys with appropriate description:
NSCameraUsageDescription
NSMicrophoneUsageDescription
NSPhotoLibraryUsageDescription
- 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 Phases
that 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'
.
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜react-native-zoom-us
and addRNZoomUs.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNZoomUs.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)< - Follow Mostly automatic installation-> Extra steps for iOS
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import ch.milosz.rnzoomus.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
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,
zoomAccessToken // zak token
// NOTE: userId, userType 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