@zoom/meetingsdk-react-native 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +82 -0
- package/android/build.gradle +183 -0
- package/android/gradle.properties +4 -0
- package/android/src/main/AndroidManifest.xml +4 -0
- package/android/src/main/java/com/reactnativezoom/sdk/RNZoomSDKModule.java +349 -0
- package/android/src/main/java/com/reactnativezoom/sdk/RNZoomSDKPackage.java +26 -0
- package/android/src/main/java/com/reactnativezoom/sdk/Utils.java +15 -0
- package/android/src/main/java/com/reactnativezoom/sdk/convert/RNZoomSDKEnumConvert.java +379 -0
- package/ios/RNZoomSDK.h +7 -0
- package/ios/RNZoomSDK.m +173 -0
- package/ios/ZoomHeaders/MobileRTC.h +344 -0
- package/ios/ZoomHeaders/MobileRTCAICQueryHelper.h +125 -0
- package/ios/ZoomHeaders/MobileRTCAICSmartSummaryHelper.h +107 -0
- package/ios/ZoomHeaders/MobileRTCAnnotationService.h +189 -0
- package/ios/ZoomHeaders/MobileRTCArchiveConfrimHandle.h +29 -0
- package/ios/ZoomHeaders/MobileRTCAudioRawData.h +49 -0
- package/ios/ZoomHeaders/MobileRTCAudioRawDataHelper.h +29 -0
- package/ios/ZoomHeaders/MobileRTCAudioSender.h +22 -0
- package/ios/ZoomHeaders/MobileRTCAudioSourceHelper.h +21 -0
- package/ios/ZoomHeaders/MobileRTCAuthService.h +258 -0
- package/ios/ZoomHeaders/MobileRTCAutoFramingParameter.h +25 -0
- package/ios/ZoomHeaders/MobileRTCBORole.h +446 -0
- package/ios/ZoomHeaders/MobileRTCCallCountryCode.h +33 -0
- package/ios/ZoomHeaders/MobileRTCCameraControlService.h +112 -0
- package/ios/ZoomHeaders/MobileRTCConstants.h +1430 -0
- package/ios/ZoomHeaders/MobileRTCDirectShareService.h +82 -0
- package/ios/ZoomHeaders/MobileRTCInMeetingDeviceInfo.h +36 -0
- package/ios/ZoomHeaders/MobileRTCInviteHelper.h +115 -0
- package/ios/ZoomHeaders/MobileRTCLiveTranscriptionLanguage.h +27 -0
- package/ios/ZoomHeaders/MobileRTCMeetingActionItem.h +56 -0
- package/ios/ZoomHeaders/MobileRTCMeetingChat.h +215 -0
- package/ios/ZoomHeaders/MobileRTCMeetingDelegate.h +1687 -0
- package/ios/ZoomHeaders/MobileRTCMeetingService+AICompanion.h +150 -0
- package/ios/ZoomHeaders/MobileRTCMeetingService+AppShare.h +158 -0
- package/ios/ZoomHeaders/MobileRTCMeetingService+Audio.h +154 -0
- package/ios/ZoomHeaders/MobileRTCMeetingService+Avatar.h +100 -0
- package/ios/ZoomHeaders/MobileRTCMeetingService+BO.h +79 -0
- package/ios/ZoomHeaders/MobileRTCMeetingService+Chat.h +149 -0
- package/ios/ZoomHeaders/MobileRTCMeetingService+Customize.h +99 -0
- package/ios/ZoomHeaders/MobileRTCMeetingService+Encryption.h +59 -0
- package/ios/ZoomHeaders/MobileRTCMeetingService+InMeeting.h +586 -0
- package/ios/ZoomHeaders/MobileRTCMeetingService+Interpretation.h +361 -0
- package/ios/ZoomHeaders/MobileRTCMeetingService+LiveTranscription.h +217 -0
- package/ios/ZoomHeaders/MobileRTCMeetingService+Phone.h +84 -0
- package/ios/ZoomHeaders/MobileRTCMeetingService+Polling.h +331 -0
- package/ios/ZoomHeaders/MobileRTCMeetingService+QA.h +296 -0
- package/ios/ZoomHeaders/MobileRTCMeetingService+RawArchiving.h +26 -0
- package/ios/ZoomHeaders/MobileRTCMeetingService+Reaction.h +44 -0
- package/ios/ZoomHeaders/MobileRTCMeetingService+SmartSummary.h +86 -0
- package/ios/ZoomHeaders/MobileRTCMeetingService+User.h +192 -0
- package/ios/ZoomHeaders/MobileRTCMeetingService+Video.h +243 -0
- package/ios/ZoomHeaders/MobileRTCMeetingService+VirtualBackground.h +118 -0
- package/ios/ZoomHeaders/MobileRTCMeetingService+Webinar.h +215 -0
- package/ios/ZoomHeaders/MobileRTCMeetingService+Whiteboard.h +143 -0
- package/ios/ZoomHeaders/MobileRTCMeetingService.h +340 -0
- package/ios/ZoomHeaders/MobileRTCMeetingSettings.h +635 -0
- package/ios/ZoomHeaders/MobileRTCMeetingUserInfo.h +205 -0
- package/ios/ZoomHeaders/MobileRTCNotificationServiceHelper.h +63 -0
- package/ios/ZoomHeaders/MobileRTCPreProcessRawData.h +59 -0
- package/ios/ZoomHeaders/MobileRTCPresenceHelper.h +235 -0
- package/ios/ZoomHeaders/MobileRTCQAItem.h +62 -0
- package/ios/ZoomHeaders/MobileRTCRawLiveStreamInfo.h +31 -0
- package/ios/ZoomHeaders/MobileRTCReminderHelper.h +126 -0
- package/ios/ZoomHeaders/MobileRTCRemoteControlService.h +145 -0
- package/ios/ZoomHeaders/MobileRTCRenderer.h +58 -0
- package/ios/ZoomHeaders/MobileRTCRequestRawLiveStreamPrivilegeHandler.h +56 -0
- package/ios/ZoomHeaders/MobileRTCReturnToMainSessionHandler.h +28 -0
- package/ios/ZoomHeaders/MobileRTCRoomDevice.h +43 -0
- package/ios/ZoomHeaders/MobileRTCSMSService.h +109 -0
- package/ios/ZoomHeaders/MobileRTCShareAudioSender.h +32 -0
- package/ios/ZoomHeaders/MobileRTCShareSender.h +24 -0
- package/ios/ZoomHeaders/MobileRTCShareSourceHelper.h +24 -0
- package/ios/ZoomHeaders/MobileRTCVideoCapabilityItem.h +26 -0
- package/ios/ZoomHeaders/MobileRTCVideoRawData.h +71 -0
- package/ios/ZoomHeaders/MobileRTCVideoSender.h +25 -0
- package/ios/ZoomHeaders/MobileRTCVideoSourceHelper.h +27 -0
- package/ios/ZoomHeaders/MobileRTCVideoView.h +95 -0
- package/ios/ZoomHeaders/MobileRTCWaitingRoomService.h +205 -0
- package/ios/ZoomHeaders/MobileRTCWebinarInputScreenNameHandler.h +23 -0
- package/ios/ZoomMeetingSDK.xcodeproj/project.pbxproj +252 -0
- package/lib/commonjs/Context.js +17 -0
- package/lib/commonjs/Context.js.map +1 -0
- package/lib/commonjs/ZoomSDKProvider.js +21 -0
- package/lib/commonjs/ZoomSDKProvider.js.map +1 -0
- package/lib/commonjs/hooks/index.js +17 -0
- package/lib/commonjs/hooks/index.js.map +1 -0
- package/lib/commonjs/hooks/useSDKHandler.js +45 -0
- package/lib/commonjs/hooks/useSDKHandler.js.map +1 -0
- package/lib/commonjs/hooks/useZoom.js +13 -0
- package/lib/commonjs/hooks/useZoom.js.map +1 -0
- package/lib/commonjs/index.js +43 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/native/ZoomSDK.js +37 -0
- package/lib/commonjs/native/ZoomSDK.js.map +1 -0
- package/lib/commonjs/utils/validation.js +24 -0
- package/lib/commonjs/utils/validation.js.map +1 -0
- package/lib/module/Context.js +11 -0
- package/lib/module/Context.js.map +1 -0
- package/lib/module/ZoomSDKProvider.js +13 -0
- package/lib/module/ZoomSDKProvider.js.map +1 -0
- package/lib/module/hooks/index.js +2 -0
- package/lib/module/hooks/index.js.map +1 -0
- package/lib/module/hooks/useSDKHandler.js +39 -0
- package/lib/module/hooks/useSDKHandler.js.map +1 -0
- package/lib/module/hooks/useZoom.js +7 -0
- package/lib/module/hooks/useZoom.js.map +1 -0
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/native/ZoomSDK.js +30 -0
- package/lib/module/native/ZoomSDK.js.map +1 -0
- package/lib/module/utils/validation.js +15 -0
- package/lib/module/utils/validation.js.map +1 -0
- package/lib/typescript/Context.d.ts +9 -0
- package/lib/typescript/ZoomSDKProvider.d.ts +8 -0
- package/lib/typescript/hooks/index.d.ts +1 -0
- package/lib/typescript/hooks/useSDKHandler.d.ts +3 -0
- package/lib/typescript/hooks/useZoom.d.ts +1 -0
- package/lib/typescript/index.d.ts +5 -0
- package/lib/typescript/native/ZoomSDK.d.ts +89 -0
- package/lib/typescript/utils/validation.d.ts +2 -0
- package/meetingsdk-react-native.podspec +19 -0
- package/package.json +160 -0
- package/src/Context.ts +22 -0
- package/src/ZoomSDKProvider.tsx +16 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useSDKHandler.ts +52 -0
- package/src/hooks/useZoom.ts +9 -0
- package/src/index.tsx +6 -0
- package/src/native/ZoomSDK.ts +120 -0
- package/src/utils/validation.ts +36 -0
package/README.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Zoom Meeting SDK for React Native
|
|
2
|
+
|
|
3
|
+
## Installation
|
|
4
|
+
|
|
5
|
+
In your React Native project, install the Meeting SDK:
|
|
6
|
+
|
|
7
|
+
`$ npm install @zoom/meetingsdk-react-native --save`
|
|
8
|
+
|
|
9
|
+
In the iOS and Android folders in your project, you will also need to [install the iOS and Android Zoom Meeting SDKs](https://developers.zoom.us/docs/meeting-sdk/react-native/), respectively.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
In the component file where you want to use the Meeting SDK, import `ZoomSDKProvider` and `useZoom`.
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
import { ZoomSDKProvider, useZoom } from '@zoom/meetingsdk-react-native';
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Wrap your application with `ZoomSDKProvider` and set the required configuration properties.
|
|
20
|
+
|
|
21
|
+
```js
|
|
22
|
+
{...}
|
|
23
|
+
return (
|
|
24
|
+
<ZoomSDKProvider
|
|
25
|
+
config={{
|
|
26
|
+
jwtToken: '{Your Zoom JWT Token}',
|
|
27
|
+
domain: 'zoom.us',
|
|
28
|
+
enableLog: true,
|
|
29
|
+
logSize: 5,
|
|
30
|
+
}}>
|
|
31
|
+
<RestOfTheApp />
|
|
32
|
+
</ZoomSDKProvider>
|
|
33
|
+
)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Get the Meeting SDK instance.
|
|
37
|
+
|
|
38
|
+
```js
|
|
39
|
+
const zoom = useZoom();
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Generate an [SDK JWT Token](https://developers.zoom.us/docs/meeting-sdk/auth/).
|
|
43
|
+
|
|
44
|
+
Then, join a meeting.
|
|
45
|
+
|
|
46
|
+
```js
|
|
47
|
+
await zoom.joinMeeting({
|
|
48
|
+
userName: displayName,
|
|
49
|
+
meetingNumber: meetingNumber,
|
|
50
|
+
password: meetingPassword,
|
|
51
|
+
});
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Sample App
|
|
55
|
+
|
|
56
|
+
Checkout the Zoom React Native Meeting SDK Sample App in the `example` directory.
|
|
57
|
+
|
|
58
|
+
## Documentation
|
|
59
|
+
Please visit [Meeting SDK for React Native](https://developers.zoom.us/docs/meeting-sdk/react-native) to learn how to use the SDK wrapper and run the sample application.
|
|
60
|
+
|
|
61
|
+
For the full list of APIs and Event Listeners, see the [Reference](https://marketplacefront.zoom.us/sdk/meeting/react-native/annotated.html).
|
|
62
|
+
|
|
63
|
+
## Need help?
|
|
64
|
+
|
|
65
|
+
If you're looking for help, try [Developer Support](https://devsupport.zoom.us/) or our [Developer Forum](https://devforum.zoom.us). Priority support is also available with [Premier Developer Support plans](https://explore.zoom.us/en/support-plans/developer/).
|
|
66
|
+
|
|
67
|
+
## Changelog
|
|
68
|
+
|
|
69
|
+
For the changelog, see [Meeting SDK for React Native](https://developers.zoom.us/changelog/meeting-sdk/react-native).
|
|
70
|
+
|
|
71
|
+
## License
|
|
72
|
+
|
|
73
|
+
Use of this SDK is subject to our [License and Terms of Use](https://explore.zoom.us/en/legal/zoom-api-license-and-tou/);
|
|
74
|
+
|
|
75
|
+
## Open Source Software Source Code
|
|
76
|
+
|
|
77
|
+
Some licenses for OSS contained in our products give you the right to access the source code under said license. You may obtain a copy of source code for the relevant OSS via the following link: https://explore.zoom.us/en/opensource/source/. Please obtain independent legal advice or counsel to determine your responsibility to make source code available under any specific OSS project.
|
|
78
|
+
|
|
79
|
+
Please see [oss_attribution.txt](oss_attribution.txt) for more information.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
Copyright ©2024 Zoom Video Communications, Inc. All rights reserved.
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
buildscript {
|
|
2
|
+
// Buildscript is evaluated before everything else so we can't use getExtOrDefault
|
|
3
|
+
def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['ZoomMeetingSDK_kotlinVersion']
|
|
4
|
+
|
|
5
|
+
repositories {
|
|
6
|
+
google()
|
|
7
|
+
mavenCentral()
|
|
8
|
+
jcenter()
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
dependencies {
|
|
12
|
+
classpath 'com.android.tools.build:gradle:7.3.1'
|
|
13
|
+
// noinspection DifferentKotlinGradleVersion
|
|
14
|
+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
apply plugin: 'com.android.library'
|
|
19
|
+
apply plugin: 'kotlin-android'
|
|
20
|
+
|
|
21
|
+
def getExtOrDefault(name) {
|
|
22
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['ZoomMeetingSDK_' + name]
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
def getExtOrIntegerDefault(name) {
|
|
26
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['ZoomMeetingSDK_' + name]).toInteger()
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
android {
|
|
30
|
+
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
|
|
31
|
+
buildToolsVersion getExtOrDefault('buildToolsVersion')
|
|
32
|
+
defaultConfig {
|
|
33
|
+
minSdkVersion 23
|
|
34
|
+
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
|
|
35
|
+
versionCode 1
|
|
36
|
+
versionName "1.0"
|
|
37
|
+
ndkVersion = "24.0.8215888"
|
|
38
|
+
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
buildTypes {
|
|
42
|
+
release {
|
|
43
|
+
minifyEnabled false
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
lintOptions {
|
|
47
|
+
disable 'GradleCompatible'
|
|
48
|
+
}
|
|
49
|
+
compileOptions {
|
|
50
|
+
sourceCompatibility JavaVersion.VERSION_11
|
|
51
|
+
targetCompatibility JavaVersion.VERSION_11
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
repositories {
|
|
56
|
+
google()
|
|
57
|
+
mavenCentral()
|
|
58
|
+
jcenter()
|
|
59
|
+
|
|
60
|
+
def found = false
|
|
61
|
+
def defaultDir = null
|
|
62
|
+
def androidSourcesName = 'React Native sources'
|
|
63
|
+
|
|
64
|
+
if (rootProject.ext.has('reactNativeAndroidRoot')) {
|
|
65
|
+
defaultDir = rootProject.ext.get('reactNativeAndroidRoot')
|
|
66
|
+
} else {
|
|
67
|
+
defaultDir = new File(
|
|
68
|
+
projectDir,
|
|
69
|
+
'/../../../node_modules/react-native/android'
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (defaultDir.exists()) {
|
|
74
|
+
maven {
|
|
75
|
+
url defaultDir.toString()
|
|
76
|
+
name androidSourcesName
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}")
|
|
80
|
+
found = true
|
|
81
|
+
} else {
|
|
82
|
+
def parentDir = rootProject.projectDir
|
|
83
|
+
|
|
84
|
+
1.upto(5, {
|
|
85
|
+
if (found) return true
|
|
86
|
+
parentDir = parentDir.parentFile
|
|
87
|
+
|
|
88
|
+
def androidSourcesDir = new File(
|
|
89
|
+
parentDir,
|
|
90
|
+
'node_modules/react-native'
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
def androidPrebuiltBinaryDir = new File(
|
|
94
|
+
parentDir,
|
|
95
|
+
'node_modules/react-native/android'
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
if (androidPrebuiltBinaryDir.exists()) {
|
|
99
|
+
maven {
|
|
100
|
+
url androidPrebuiltBinaryDir.toString()
|
|
101
|
+
name androidSourcesName
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
logger.info(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}")
|
|
105
|
+
found = true
|
|
106
|
+
} else if (androidSourcesDir.exists()) {
|
|
107
|
+
maven {
|
|
108
|
+
url androidSourcesDir.toString()
|
|
109
|
+
name androidSourcesName
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
logger.info(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}")
|
|
113
|
+
found = true
|
|
114
|
+
}
|
|
115
|
+
})
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (!found) {
|
|
119
|
+
throw new GradleException(
|
|
120
|
+
"${project.name}: unable to locate React Native android sources. " +
|
|
121
|
+
"Ensure you have you installed React Native as a dependency in your project and try again."
|
|
122
|
+
)
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
def kotlin_version = getExtOrDefault('kotlinVersion')
|
|
127
|
+
|
|
128
|
+
dependencies {
|
|
129
|
+
// noinspection GradleDynamicVersion
|
|
130
|
+
api 'com.facebook.react:react-android:+'
|
|
131
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
132
|
+
|
|
133
|
+
implementation "androidx.security:security-crypto:1.1.0-alpha05"
|
|
134
|
+
implementation "com.google.crypto.tink:tink-android:1.7.0"
|
|
135
|
+
implementation "com.google.android.exoplayer:exoplayer-core:2.17.1"
|
|
136
|
+
implementation "com.google.android.exoplayer:exoplayer-ui:2.17.1"
|
|
137
|
+
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
|
|
138
|
+
|
|
139
|
+
implementation "androidx.appcompat:appcompat:1.3.1"
|
|
140
|
+
implementation "androidx.constraintlayout:constraintlayout:2.1.0"
|
|
141
|
+
implementation "com.google.android.material:material:1.8.0"
|
|
142
|
+
implementation "com.google.android.flexbox:flexbox:3.0.0"
|
|
143
|
+
implementation "androidx.multidex:multidex:2.0.1"
|
|
144
|
+
implementation "com.google.code.gson:gson:2.9.1"
|
|
145
|
+
implementation "com.github.bumptech.glide:annotations:4.11.0"
|
|
146
|
+
implementation "com.github.bumptech.glide:glide:4.11.0"
|
|
147
|
+
implementation "org.greenrobot:eventbus:3.1.1"
|
|
148
|
+
|
|
149
|
+
implementation "androidx.recyclerview:recyclerview:1.2.1"
|
|
150
|
+
implementation "com.airbnb.android:lottie:4.0.0"
|
|
151
|
+
|
|
152
|
+
implementation "androidx.window:window:1.0.0"
|
|
153
|
+
|
|
154
|
+
implementation "androidx.window:window-java:1.0.0"
|
|
155
|
+
|
|
156
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.8.20"
|
|
157
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.20"
|
|
158
|
+
|
|
159
|
+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2"
|
|
160
|
+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2"
|
|
161
|
+
implementation "androidx.core:core-ktx:1.8.0"
|
|
162
|
+
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1"
|
|
163
|
+
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.6.1"
|
|
164
|
+
|
|
165
|
+
implementation "androidx.fragment:fragment-ktx:1.4.1"
|
|
166
|
+
implementation "io.reactivex.rxjava2:rxandroid:2.1.1"
|
|
167
|
+
implementation "org.greenrobot:eventbus:3.1.1"
|
|
168
|
+
implementation "com.davemorrissey.labs:subsampling-scale-image-view:3.10.0"
|
|
169
|
+
implementation "androidx.core:core-splashscreen:1.0.1"
|
|
170
|
+
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.6.1"
|
|
171
|
+
implementation "androidx.databinding:viewbinding:7.1.2"
|
|
172
|
+
implementation "io.reactivex.rxjava3:rxandroid:3.0.2"
|
|
173
|
+
|
|
174
|
+
implementation "androidx.compose.material3:material3:1.1.1"
|
|
175
|
+
implementation "androidx.compose.ui:ui-tooling-preview:1.4.1"
|
|
176
|
+
implementation "androidx.constraintlayout:constraintlayout-compose:1.0.1"
|
|
177
|
+
implementation "androidx.activity:activity-compose:1.6.1"
|
|
178
|
+
implementation "androidx.lifecycle:lifecycle-runtime-compose:2.6.1"
|
|
179
|
+
implementation "androidx.navigation:navigation-compose:2.6.0"
|
|
180
|
+
implementation "io.coil-kt:coil-compose:2.3.0"
|
|
181
|
+
|
|
182
|
+
implementation project(':mobilertc')
|
|
183
|
+
}
|
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
package com.reactnativezoom.sdk;
|
|
2
|
+
|
|
3
|
+
import android.app.Service;
|
|
4
|
+
import android.util.DisplayMetrics;
|
|
5
|
+
import android.util.Log;
|
|
6
|
+
import android.view.Display;
|
|
7
|
+
import android.view.WindowManager;
|
|
8
|
+
import java.util.Locale;
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Nullable;
|
|
11
|
+
|
|
12
|
+
import com.facebook.react.bridge.Arguments;
|
|
13
|
+
import com.facebook.react.bridge.LifecycleEventListener;
|
|
14
|
+
import com.facebook.react.bridge.Promise;
|
|
15
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
16
|
+
import com.facebook.react.bridge.ReactContext;
|
|
17
|
+
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
18
|
+
import com.facebook.react.bridge.ReactMethod;
|
|
19
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
20
|
+
import com.facebook.react.bridge.WritableMap;
|
|
21
|
+
import com.facebook.react.modules.core.DeviceEventManagerModule;
|
|
22
|
+
import com.reactnativezoom.sdk.convert.RNZoomSDKEnumConvert;
|
|
23
|
+
|
|
24
|
+
import java.util.List;
|
|
25
|
+
|
|
26
|
+
import us.zoom.sdk.InMeetingServiceListener.VideoStatus;
|
|
27
|
+
import us.zoom.sdk.InMeetingServiceListener.AudioStatus;
|
|
28
|
+
import us.zoom.sdk.VideoQuality;
|
|
29
|
+
import us.zoom.sdk.InMeetingServiceListener.UVCCameraStatus;
|
|
30
|
+
import us.zoom.sdk.InMeetingAudioController.MobileRTCMicrophoneError;
|
|
31
|
+
import us.zoom.sdk.ZoomSDKChatMessageType;
|
|
32
|
+
import us.zoom.sdk.ChatMessageDeleteType;
|
|
33
|
+
import us.zoom.sdk.InMeetingChatController;
|
|
34
|
+
import us.zoom.sdk.InMeetingAudioController;
|
|
35
|
+
import us.zoom.sdk.InMeetingChatController.MobileRTCWebinarPanelistChatPrivilege;
|
|
36
|
+
import us.zoom.sdk.FreeMeetingNeedUpgradeType;
|
|
37
|
+
import us.zoom.sdk.InMeetingServiceListener.RecordingStatus;
|
|
38
|
+
import us.zoom.sdk.LocalRecordingRequestPrivilegeStatus;
|
|
39
|
+
import us.zoom.sdk.MobileRTCFocusModeShareType;
|
|
40
|
+
import us.zoom.sdk.CameraControlRequestType;
|
|
41
|
+
//import us.zoom.sdk.CameraControlRequestResult;
|
|
42
|
+
import us.zoom.sdk.InMeetingShareController;
|
|
43
|
+
|
|
44
|
+
import us.zoom.sdk.MeetingViewsOptions;
|
|
45
|
+
import us.zoom.sdk.JoinMeetingOptions;
|
|
46
|
+
import us.zoom.sdk.MeetingService;
|
|
47
|
+
import us.zoom.sdk.ZoomSDK;
|
|
48
|
+
import us.zoom.sdk.MeetingSettingsHelper;
|
|
49
|
+
import us.zoom.sdk.ZoomSDKInitParams;
|
|
50
|
+
import us.zoom.sdk.MeetingViewsOptions;
|
|
51
|
+
import us.zoom.sdk.ZoomSDKInitializeListener;
|
|
52
|
+
import us.zoom.sdk.InMeetingServiceListener;
|
|
53
|
+
import us.zoom.sdk.MeetingServiceListener;
|
|
54
|
+
import us.zoom.sdk.MeetingError;
|
|
55
|
+
import us.zoom.sdk.InMeetingShareController.InMeetingShareListener;
|
|
56
|
+
import us.zoom.sdk.ICameraControlRequestHandler;
|
|
57
|
+
import us.zoom.sdk.JoinMeetingParam4WithoutLogin;
|
|
58
|
+
import us.zoom.sdk.IMeetingArchiveConfirmHandler;
|
|
59
|
+
import us.zoom.sdk.IRequestLocalRecordingPrivilegeHandler;
|
|
60
|
+
import us.zoom.sdk.InMeetingEventHandler;
|
|
61
|
+
import us.zoom.sdk.IMeetingInputUserInfoHandler;
|
|
62
|
+
import us.zoom.sdk.InMeetingChatMessage;
|
|
63
|
+
import us.zoom.sdk.MeetingStatus;
|
|
64
|
+
import us.zoom.sdk.MeetingParameter;
|
|
65
|
+
import us.zoom.sdk.InMeetingShareController;
|
|
66
|
+
import us.zoom.sdk.InMeetingShareController.InMeetingShareListener;
|
|
67
|
+
import us.zoom.sdk.SharingStatus;
|
|
68
|
+
import us.zoom.sdk.ShareSettingType;
|
|
69
|
+
import us.zoom.sdk.StartMeetingOptions;
|
|
70
|
+
import us.zoom.sdk.StartMeetingParamsWithoutLogin;
|
|
71
|
+
|
|
72
|
+
public class RNZoomSDKModule extends ReactContextBaseJavaModule implements ZoomSDKInitializeListener, LifecycleEventListener {
|
|
73
|
+
|
|
74
|
+
private final String DEBUG_TAG = "ZoomSDKDebug";
|
|
75
|
+
private final ReactApplicationContext reactContext;
|
|
76
|
+
|
|
77
|
+
protected Display display;
|
|
78
|
+
protected DisplayMetrics displayMetrics;
|
|
79
|
+
|
|
80
|
+
RNZoomSDKModule(ReactApplicationContext reactContext) {
|
|
81
|
+
super(reactContext);
|
|
82
|
+
this.reactContext = reactContext;
|
|
83
|
+
reactContext.addLifecycleEventListener(this);
|
|
84
|
+
|
|
85
|
+
display = ((WindowManager) reactContext.getSystemService(Service.WINDOW_SERVICE)).getDefaultDisplay();
|
|
86
|
+
displayMetrics = new DisplayMetrics();
|
|
87
|
+
display.getMetrics(displayMetrics);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@Override
|
|
91
|
+
public String getName() {
|
|
92
|
+
return "RNZoomSDK";
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
public String[] supportedEvents() {
|
|
96
|
+
return new String[] {
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@ReactMethod
|
|
101
|
+
public void isInitialized(Promise promise) {
|
|
102
|
+
if (Utils.checkRNActivity(reactContext, promise)) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
reactContext.getCurrentActivity().runOnUiThread(new Runnable() {
|
|
106
|
+
@Override
|
|
107
|
+
public void run() {
|
|
108
|
+
try {
|
|
109
|
+
ZoomSDK zoomSDK = ZoomSDK.getInstance();
|
|
110
|
+
promise.resolve(zoomSDK.isInitialized());
|
|
111
|
+
} catch (Exception e) {
|
|
112
|
+
promise.reject("SDK_UNEXPECTED_EXCEPTION", e);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
@ReactMethod
|
|
119
|
+
public void initSDK(ReadableMap config, Promise promise) {
|
|
120
|
+
if (Utils.checkRNActivity(reactContext, promise)) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
reactContext.getCurrentActivity().runOnUiThread(new Runnable() {
|
|
124
|
+
@Override
|
|
125
|
+
public void run() {
|
|
126
|
+
ZoomSDK zoomSDK = ZoomSDK.getInstance();
|
|
127
|
+
ZoomSDKInitParams initParams = new ZoomSDKInitParams();
|
|
128
|
+
if (config.hasKey("jwtToken")) {
|
|
129
|
+
initParams.jwtToken = config.getString("jwtToken");
|
|
130
|
+
}
|
|
131
|
+
if (config.hasKey("domain")) {
|
|
132
|
+
initParams.domain = config.getString("domain");
|
|
133
|
+
}
|
|
134
|
+
if (config.hasKey("enableLog")) {
|
|
135
|
+
initParams.enableLog = config.getBoolean("enableLog");
|
|
136
|
+
}
|
|
137
|
+
if (config.hasKey("logSize")) {
|
|
138
|
+
initParams.logSize = config.getInt("logSize");
|
|
139
|
+
} else {
|
|
140
|
+
initParams.logSize = 5;
|
|
141
|
+
}
|
|
142
|
+
initParams.enableGenerateDump =true;
|
|
143
|
+
|
|
144
|
+
zoomSDK.initialize(reactContext.getCurrentActivity(), RNZoomSDKModule.this, initParams);
|
|
145
|
+
|
|
146
|
+
Log.d(DEBUG_TAG, "SDK initialized successfully");
|
|
147
|
+
|
|
148
|
+
promise.resolve(true);
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
@ReactMethod
|
|
154
|
+
public void updateMeetingSetting(ReadableMap config, Promise promise) {
|
|
155
|
+
if (Utils.checkRNActivity(reactContext, promise)) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
reactContext.getCurrentActivity().runOnUiThread(new Runnable() {
|
|
159
|
+
@Override
|
|
160
|
+
public void run() {
|
|
161
|
+
ZoomSDK zoomSDK = ZoomSDK.getInstance();
|
|
162
|
+
if (zoomSDK.isInitialized()) {
|
|
163
|
+
MeetingSettingsHelper meetingSettingsHelper = ZoomSDK.getInstance().getMeetingSettingsHelper();
|
|
164
|
+
if (config.hasKey("disableVideoPreview")) {
|
|
165
|
+
meetingSettingsHelper.disableShowVideoPreviewWhenJoinMeeting(config.getBoolean("disableVideoPreview"));
|
|
166
|
+
}
|
|
167
|
+
if (config.hasKey("enableCustomizedMeetingUI")) {
|
|
168
|
+
meetingSettingsHelper.setCustomizedMeetingUIEnabled(config.getBoolean("enableCustomizedMeetingUI"));
|
|
169
|
+
}
|
|
170
|
+
if (config.hasKey("disableClearWebKitCache")) {
|
|
171
|
+
meetingSettingsHelper.disableClearWebKitCache(config.getBoolean("disableClearWebKitCache"));
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
String[] parts = config.getString("language").split("-");
|
|
175
|
+
Locale locale = parts.length == 1
|
|
176
|
+
? new Locale(parts[0])
|
|
177
|
+
: new Locale(parts[0], parts[1]);
|
|
178
|
+
zoomSDK.setSdkLocale(reactContext, locale);
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
@ReactMethod
|
|
184
|
+
public void joinMeeting(ReadableMap config, Promise promise) {
|
|
185
|
+
if (Utils.checkRNActivity(reactContext, promise)) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
reactContext.getCurrentActivity().runOnUiThread(new Runnable() {
|
|
189
|
+
@Override
|
|
190
|
+
public void run() {
|
|
191
|
+
try {
|
|
192
|
+
MeetingService meetingService = ZoomSDK.getInstance().getMeetingService();
|
|
193
|
+
|
|
194
|
+
JoinMeetingOptions joinOptions = new JoinMeetingOptions();
|
|
195
|
+
if(config.hasKey("noDrivingMode")) joinOptions.no_driving_mode = config.getBoolean("noDrivingMode");
|
|
196
|
+
if(config.hasKey("noInvite")) joinOptions.no_invite = config.getBoolean("noInvite");
|
|
197
|
+
if(config.hasKey("noMeetingEndMessage")) joinOptions.no_meeting_end_message = config.getBoolean("noMeetingEndMessage");
|
|
198
|
+
if(config.hasKey("noMeetingErrorMessage")) joinOptions.no_meeting_error_message = config.getBoolean("noMeetingErrorMessage");
|
|
199
|
+
if(config.hasKey("noTitleBar")) joinOptions.no_titlebar = config.getBoolean("noTitleBar");
|
|
200
|
+
if(config.hasKey("noBottomToolbar")) joinOptions.no_bottom_toolbar = config.getBoolean("noBottomToolbar");
|
|
201
|
+
if(config.hasKey("noPhoneDialIn")) joinOptions.no_dial_in_via_phone = config.getBoolean("noPhoneDialIn");
|
|
202
|
+
if(config.hasKey("noPhoneDialOut")) joinOptions.no_dial_out_to_phone = config.getBoolean("noPhoneDialOut");
|
|
203
|
+
if(config.hasKey("noDisconnectAudio")) joinOptions.no_disconnect_audio = config.getBoolean("noDisconnectAudio");
|
|
204
|
+
if(config.hasKey("noRecord")) joinOptions.no_record = config.getBoolean("noRecord");
|
|
205
|
+
if(config.hasKey("noShare")) joinOptions.no_share = config.getBoolean("noShare");
|
|
206
|
+
if(config.hasKey("noVideo")) joinOptions.no_video = config.getBoolean("noVideo");
|
|
207
|
+
if(config.hasKey("inviteOptions")) joinOptions.invite_options = RNZoomSDKEnumConvert.getInviteOptions(config.getString("inviteOptions"));
|
|
208
|
+
if(config.hasKey("customerKey")) joinOptions.customer_key = config.getString("customerKey");
|
|
209
|
+
if(config.hasKey("customMeetingId")) joinOptions.custom_meeting_id = config.getString("customMeetingId");
|
|
210
|
+
if(config.hasKey("noUnmuteConfirmDialog")) joinOptions.no_unmute_confirm_dialog = config.getBoolean("noUnmuteConfirmDialog");
|
|
211
|
+
if(config.hasKey("noWebinarRegisterDialog")) joinOptions.no_webinar_register_dialog = config.getBoolean("noWebinarRegisterDialog");
|
|
212
|
+
if(config.hasKey("noChatMsgToast")) joinOptions.no_chat_msg_toast = config.getBoolean("noChatMsgToast");
|
|
213
|
+
if(config.hasKey("noAudio")) joinOptions.no_audio = config.getBoolean("noAudio");
|
|
214
|
+
if(config.hasKey("webinarToken")) joinOptions.webinar_token = config.getString("webinarToken");
|
|
215
|
+
if(config.hasKey("meetingViewsOptions")) joinOptions.meeting_views_options = RNZoomSDKEnumConvert.getMeetingViewsOptions(config.getString("meetingViewsOptions"));
|
|
216
|
+
|
|
217
|
+
JoinMeetingParam4WithoutLogin params = new JoinMeetingParam4WithoutLogin();
|
|
218
|
+
params.displayName = config.getString("userName");
|
|
219
|
+
params.meetingNo = config.getString("meetingNumber");
|
|
220
|
+
if (config.hasKey("password")) params.password = config.getString("password");
|
|
221
|
+
if (config.hasKey("zoomAccessToken")) params.zoomAccessToken = config.getString("zoomAccessToken");
|
|
222
|
+
if (config.hasKey("vanityID")) params.vanityID = config.getString("vanityID");
|
|
223
|
+
if (config.hasKey("webinarToken")) params.webinarToken = config.getString("webinarToken");
|
|
224
|
+
if (config.hasKey("joinToken")) params.join_token = config.getString("joinToken");
|
|
225
|
+
if (config.hasKey("appPrivilegeToken")) params.appPrivilegeToken = config.getString("appPrivilegeToken");
|
|
226
|
+
if (config.hasKey("isMyVoiceInMix")) params.isMyVoiceInMix = config.getBoolean("isMyVoiceInMix");
|
|
227
|
+
if (config.hasKey("isAudioRawDataStereo")) params.isAudioRawDataStereo = config.getBoolean("isAudioRawDataStereo");
|
|
228
|
+
|
|
229
|
+
int joinMeetingResult = meetingService.joinMeetingWithParams(reactContext.getCurrentActivity(), params, joinOptions);
|
|
230
|
+
promise.resolve(joinMeetingResult);
|
|
231
|
+
|
|
232
|
+
} catch(Exception e) {
|
|
233
|
+
promise.reject("joinMeeting_failure", "Join meeting failed", (WritableMap) null);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
@ReactMethod
|
|
240
|
+
public void startMeeting(ReadableMap config, Promise promise) {
|
|
241
|
+
if (Utils.checkRNActivity(reactContext, promise)) {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
reactContext.getCurrentActivity().runOnUiThread(new Runnable() {
|
|
245
|
+
@Override
|
|
246
|
+
public void run() {
|
|
247
|
+
try {
|
|
248
|
+
MeetingService meetingService = ZoomSDK.getInstance().getMeetingService();
|
|
249
|
+
|
|
250
|
+
StartMeetingOptions joinOptions = new StartMeetingOptions();
|
|
251
|
+
if(config.hasKey("noDrivingMode")) joinOptions.no_driving_mode = config.getBoolean("noDrivingMode");
|
|
252
|
+
if(config.hasKey("noInvite")) joinOptions.no_invite = config.getBoolean("noInvite");
|
|
253
|
+
if(config.hasKey("noMeetingEndMessage")) joinOptions.no_meeting_end_message = config.getBoolean("noMeetingEndMessage");
|
|
254
|
+
if(config.hasKey("noMeetingErrorMessage")) joinOptions.no_meeting_error_message = config.getBoolean("noMeetingErrorMessage");
|
|
255
|
+
if(config.hasKey("noTitleBar")) joinOptions.no_titlebar = config.getBoolean("noTitleBar");
|
|
256
|
+
if(config.hasKey("noBottomToolbar")) joinOptions.no_bottom_toolbar = config.getBoolean("noBottomToolbar");
|
|
257
|
+
if(config.hasKey("noPhoneDialIn")) joinOptions.no_dial_in_via_phone = config.getBoolean("noPhoneDialIn");
|
|
258
|
+
if(config.hasKey("noPhoneDialOut")) joinOptions.no_dial_out_to_phone = config.getBoolean("noPhoneDialOut");
|
|
259
|
+
if(config.hasKey("noDisconnectAudio")) joinOptions.no_disconnect_audio = config.getBoolean("noDisconnectAudio");
|
|
260
|
+
if(config.hasKey("noRecord")) joinOptions.no_record = config.getBoolean("noRecord");
|
|
261
|
+
if(config.hasKey("noShare")) joinOptions.no_share = config.getBoolean("noShare");
|
|
262
|
+
if(config.hasKey("noVideo")) joinOptions.no_video = config.getBoolean("noVideo");
|
|
263
|
+
if(config.hasKey("inviteOptions")) joinOptions.invite_options = RNZoomSDKEnumConvert.getInviteOptions(config.getString("inviteOptions"));
|
|
264
|
+
if(config.hasKey("customerKey")) joinOptions.customer_key = config.getString("customerKey");
|
|
265
|
+
if(config.hasKey("customMeetingId")) joinOptions.custom_meeting_id = config.getString("customMeetingId");
|
|
266
|
+
if(config.hasKey("noUnmuteConfirmDialog")) joinOptions.no_unmute_confirm_dialog = config.getBoolean("noUnmuteConfirmDialog");
|
|
267
|
+
if(config.hasKey("noWebinarRegisterDialog")) joinOptions.no_webinar_register_dialog = config.getBoolean("noWebinarRegisterDialog");
|
|
268
|
+
if(config.hasKey("noChatMsgToast")) joinOptions.no_chat_msg_toast = config.getBoolean("noChatMsgToast");
|
|
269
|
+
if(config.hasKey("noAudio")) joinOptions.no_audio = config.getBoolean("noAudio");
|
|
270
|
+
if(config.hasKey("meetingViewsOptions")) joinOptions.meeting_views_options = RNZoomSDKEnumConvert.getMeetingViewsOptions(config.getString("meetingViewsOptions"));
|
|
271
|
+
|
|
272
|
+
StartMeetingParamsWithoutLogin params = new StartMeetingParamsWithoutLogin();
|
|
273
|
+
params.displayName = config.getString("userName");
|
|
274
|
+
params.meetingNo = config.getString("meetingNumber");
|
|
275
|
+
if (config.hasKey("userType")) params.userType = config.getInt("userType");
|
|
276
|
+
if (config.hasKey("zoomAccessToken")) params.zoomAccessToken = config.getString("zoomAccessToken");
|
|
277
|
+
if (config.hasKey("vanityID")) params.vanityID = config.getString("vanityID");
|
|
278
|
+
if (config.hasKey("isMyVoiceInMix")) params.isMyVoiceInMix = config.getBoolean("isMyVoiceInMix");
|
|
279
|
+
if (config.hasKey("inviteContactId")) params.inviteContactId = config.getString("inviteContactId");
|
|
280
|
+
if (config.hasKey("isAudioRawDataStereo")) params.isAudioRawDataStereo = config.getBoolean("isAudioRawDataStereo");
|
|
281
|
+
|
|
282
|
+
int startMeetingResult = meetingService.startMeetingWithParams(reactContext.getCurrentActivity(), params, joinOptions);
|
|
283
|
+
promise.resolve(startMeetingResult);
|
|
284
|
+
|
|
285
|
+
} catch(Exception e) {
|
|
286
|
+
promise.reject("startMeeting_failure", "Start meeting failed", (WritableMap) null);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
// -----------------------------------------------------------------------------------------------
|
|
293
|
+
// region ZoomSDKInitializeListener
|
|
294
|
+
// -----------------------------------------------------------------------------------------------
|
|
295
|
+
|
|
296
|
+
@Override
|
|
297
|
+
public void onZoomSDKInitializeResult(int errorCode, int internalErrorCode) {
|
|
298
|
+
Log.d(DEBUG_TAG, "onZoomSDKInitializeResult, errorCode = " + errorCode + ", internalErrorCode = " + internalErrorCode);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
@Override
|
|
302
|
+
public void onZoomAuthIdentityExpired() {
|
|
303
|
+
Log.d(DEBUG_TAG, "onZoomAuthIdentityExpired");
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
// -----------------------------------------------------------------------------------------------
|
|
307
|
+
// endregion
|
|
308
|
+
// -----------------------------------------------------------------------------------------------
|
|
309
|
+
|
|
310
|
+
// -----------------------------------------------------------------------------------------------
|
|
311
|
+
// region LifecycleEventListener
|
|
312
|
+
// -----------------------------------------------------------------------------------------------
|
|
313
|
+
|
|
314
|
+
@Override
|
|
315
|
+
public void onHostResume() {
|
|
316
|
+
Log.d(DEBUG_TAG, "onHostResume");
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
@Override
|
|
320
|
+
public void onHostPause() {
|
|
321
|
+
Log.d(DEBUG_TAG, "onHostPause");
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
@Override
|
|
325
|
+
public void onHostDestroy() {
|
|
326
|
+
Log.d(DEBUG_TAG, "onHostDestroy");
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
// -----------------------------------------------------------------------------------------------
|
|
332
|
+
// endregion
|
|
333
|
+
// -----------------------------------------------------------------------------------------------
|
|
334
|
+
|
|
335
|
+
// -----------------------------------------------------------------------------------------------
|
|
336
|
+
// region Helper Methods
|
|
337
|
+
// -----------------------------------------------------------------------------------------------
|
|
338
|
+
|
|
339
|
+
private void sendEvent(ReactContext reactContext, String eventName, @Nullable WritableMap params) {
|
|
340
|
+
reactContext
|
|
341
|
+
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
|
|
342
|
+
.emit(eventName, params);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
// -----------------------------------------------------------------------------------------------
|
|
346
|
+
// endregion
|
|
347
|
+
// -----------------------------------------------------------------------------------------------
|
|
348
|
+
|
|
349
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
package com.reactnativezoom.sdk;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.ReactPackage;
|
|
4
|
+
import com.facebook.react.bridge.NativeModule;
|
|
5
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
6
|
+
import com.facebook.react.uimanager.ViewManager;
|
|
7
|
+
|
|
8
|
+
import java.util.ArrayList;
|
|
9
|
+
import java.util.List;
|
|
10
|
+
|
|
11
|
+
public class RNZoomSDKPackage implements ReactPackage {
|
|
12
|
+
|
|
13
|
+
@Override
|
|
14
|
+
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
|
|
15
|
+
List<ViewManager> managers = new ArrayList<>();
|
|
16
|
+
return managers;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@Override
|
|
20
|
+
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
|
|
21
|
+
List<NativeModule> modules = new ArrayList<>();
|
|
22
|
+
modules.add(new RNZoomSDKModule(reactContext));
|
|
23
|
+
return modules;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
package com.reactnativezoom.sdk;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.Promise;
|
|
4
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
5
|
+
import com.facebook.react.bridge.WritableMap;
|
|
6
|
+
|
|
7
|
+
public class Utils {
|
|
8
|
+
public static boolean checkRNActivity(ReactApplicationContext reactContext, Promise promise) {
|
|
9
|
+
if (reactContext == null || reactContext.getCurrentActivity() == null) {
|
|
10
|
+
promise.reject("context_error", "Cannot get react native activity", (WritableMap) null);
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
}
|