@zoom/meetingsdk-react-native 6.4.10 → 6.6.0
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/android/build.gradle +5 -2
- package/android/gradle/verification-metadata.xml +3769 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/android/gradlew +251 -0
- package/android/gradlew.bat +94 -0
- package/android/src/main/java/com/reactnativezoom/sdk/RNZoomSDKModule.java +15 -3
- package/ios/RNZoomSDK.m +35 -7
- package/lib/commonjs/Context.js +2 -1
- package/lib/commonjs/Context.js.map +1 -1
- package/lib/commonjs/hooks/useSDKHandler.js +5 -1
- package/lib/commonjs/hooks/useSDKHandler.js.map +1 -1
- package/lib/commonjs/native/ZoomSDK.js +5 -4
- package/lib/commonjs/native/ZoomSDK.js.map +1 -1
- package/lib/commonjs/utils/validation.js +8 -1
- package/lib/commonjs/utils/validation.js.map +1 -1
- package/lib/module/Context.js +2 -1
- package/lib/module/Context.js.map +1 -1
- package/lib/module/hooks/useSDKHandler.js +5 -1
- package/lib/module/hooks/useSDKHandler.js.map +1 -1
- package/lib/module/native/ZoomSDK.js +6 -5
- package/lib/module/native/ZoomSDK.js.map +1 -1
- package/lib/module/utils/validation.js +6 -0
- package/lib/module/utils/validation.js.map +1 -1
- package/lib/typescript/Context.d.ts +1 -0
- package/lib/typescript/native/ZoomSDK.d.ts +2 -1
- package/lib/typescript/utils/validation.d.ts +1 -0
- package/meetingsdk-react-native.podspec +1 -1
- package/package.json +2 -9
- package/src/Context.ts +2 -0
- package/src/hooks/useSDKHandler.ts +5 -0
- package/src/native/ZoomSDK.ts +8 -6
- package/src/utils/validation.ts +24 -0
package/android/gradlew
ADDED
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
|
|
3
|
+
#
|
|
4
|
+
# Copyright © 2015-2021 the original authors.
|
|
5
|
+
#
|
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
# you may not use this file except in compliance with the License.
|
|
8
|
+
# You may obtain a copy of the License at
|
|
9
|
+
#
|
|
10
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
#
|
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
# See the License for the specific language governing permissions and
|
|
16
|
+
# limitations under the License.
|
|
17
|
+
#
|
|
18
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
19
|
+
#
|
|
20
|
+
|
|
21
|
+
##############################################################################
|
|
22
|
+
#
|
|
23
|
+
# Gradle start up script for POSIX generated by Gradle.
|
|
24
|
+
#
|
|
25
|
+
# Important for running:
|
|
26
|
+
#
|
|
27
|
+
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
|
28
|
+
# noncompliant, but you have some other compliant shell such as ksh or
|
|
29
|
+
# bash, then to run this script, type that shell name before the whole
|
|
30
|
+
# command line, like:
|
|
31
|
+
#
|
|
32
|
+
# ksh Gradle
|
|
33
|
+
#
|
|
34
|
+
# Busybox and similar reduced shells will NOT work, because this script
|
|
35
|
+
# requires all of these POSIX shell features:
|
|
36
|
+
# * functions;
|
|
37
|
+
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
|
38
|
+
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
|
39
|
+
# * compound commands having a testable exit status, especially «case»;
|
|
40
|
+
# * various built-in commands including «command», «set», and «ulimit».
|
|
41
|
+
#
|
|
42
|
+
# Important for patching:
|
|
43
|
+
#
|
|
44
|
+
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
|
45
|
+
# by Bash, Ksh, etc; in particular arrays are avoided.
|
|
46
|
+
#
|
|
47
|
+
# The "traditional" practice of packing multiple parameters into a
|
|
48
|
+
# space-separated string is a well documented source of bugs and security
|
|
49
|
+
# problems, so this is (mostly) avoided, by progressively accumulating
|
|
50
|
+
# options in "$@", and eventually passing that to Java.
|
|
51
|
+
#
|
|
52
|
+
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
|
53
|
+
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
|
54
|
+
# see the in-line comments for details.
|
|
55
|
+
#
|
|
56
|
+
# There are tweaks for specific operating systems such as AIX, CygWin,
|
|
57
|
+
# Darwin, MinGW, and NonStop.
|
|
58
|
+
#
|
|
59
|
+
# (3) This script is generated from the Groovy template
|
|
60
|
+
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
|
61
|
+
# within the Gradle project.
|
|
62
|
+
#
|
|
63
|
+
# You can find Gradle at https://github.com/gradle/gradle/.
|
|
64
|
+
#
|
|
65
|
+
##############################################################################
|
|
66
|
+
|
|
67
|
+
# Attempt to set APP_HOME
|
|
68
|
+
|
|
69
|
+
# Resolve links: $0 may be a link
|
|
70
|
+
app_path=$0
|
|
71
|
+
|
|
72
|
+
# Need this for daisy-chained symlinks.
|
|
73
|
+
while
|
|
74
|
+
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
|
75
|
+
[ -h "$app_path" ]
|
|
76
|
+
do
|
|
77
|
+
ls=$( ls -ld "$app_path" )
|
|
78
|
+
link=${ls#*' -> '}
|
|
79
|
+
case $link in #(
|
|
80
|
+
/*) app_path=$link ;; #(
|
|
81
|
+
*) app_path=$APP_HOME$link ;;
|
|
82
|
+
esac
|
|
83
|
+
done
|
|
84
|
+
|
|
85
|
+
# This is normally unused
|
|
86
|
+
# shellcheck disable=SC2034
|
|
87
|
+
APP_BASE_NAME=${0##*/}
|
|
88
|
+
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
|
89
|
+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
|
90
|
+
|
|
91
|
+
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
|
92
|
+
MAX_FD=maximum
|
|
93
|
+
|
|
94
|
+
warn () {
|
|
95
|
+
echo "$*"
|
|
96
|
+
} >&2
|
|
97
|
+
|
|
98
|
+
die () {
|
|
99
|
+
echo
|
|
100
|
+
echo "$*"
|
|
101
|
+
echo
|
|
102
|
+
exit 1
|
|
103
|
+
} >&2
|
|
104
|
+
|
|
105
|
+
# OS specific support (must be 'true' or 'false').
|
|
106
|
+
cygwin=false
|
|
107
|
+
msys=false
|
|
108
|
+
darwin=false
|
|
109
|
+
nonstop=false
|
|
110
|
+
case "$( uname )" in #(
|
|
111
|
+
CYGWIN* ) cygwin=true ;; #(
|
|
112
|
+
Darwin* ) darwin=true ;; #(
|
|
113
|
+
MSYS* | MINGW* ) msys=true ;; #(
|
|
114
|
+
NONSTOP* ) nonstop=true ;;
|
|
115
|
+
esac
|
|
116
|
+
|
|
117
|
+
CLASSPATH="\\\"\\\""
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
# Determine the Java command to use to start the JVM.
|
|
121
|
+
if [ -n "$JAVA_HOME" ] ; then
|
|
122
|
+
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
|
123
|
+
# IBM's JDK on AIX uses strange locations for the executables
|
|
124
|
+
JAVACMD=$JAVA_HOME/jre/sh/java
|
|
125
|
+
else
|
|
126
|
+
JAVACMD=$JAVA_HOME/bin/java
|
|
127
|
+
fi
|
|
128
|
+
if [ ! -x "$JAVACMD" ] ; then
|
|
129
|
+
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
|
130
|
+
|
|
131
|
+
Please set the JAVA_HOME variable in your environment to match the
|
|
132
|
+
location of your Java installation."
|
|
133
|
+
fi
|
|
134
|
+
else
|
|
135
|
+
JAVACMD=java
|
|
136
|
+
if ! command -v java >/dev/null 2>&1
|
|
137
|
+
then
|
|
138
|
+
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
139
|
+
|
|
140
|
+
Please set the JAVA_HOME variable in your environment to match the
|
|
141
|
+
location of your Java installation."
|
|
142
|
+
fi
|
|
143
|
+
fi
|
|
144
|
+
|
|
145
|
+
# Increase the maximum file descriptors if we can.
|
|
146
|
+
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
|
147
|
+
case $MAX_FD in #(
|
|
148
|
+
max*)
|
|
149
|
+
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
|
150
|
+
# shellcheck disable=SC2039,SC3045
|
|
151
|
+
MAX_FD=$( ulimit -H -n ) ||
|
|
152
|
+
warn "Could not query maximum file descriptor limit"
|
|
153
|
+
esac
|
|
154
|
+
case $MAX_FD in #(
|
|
155
|
+
'' | soft) :;; #(
|
|
156
|
+
*)
|
|
157
|
+
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
|
158
|
+
# shellcheck disable=SC2039,SC3045
|
|
159
|
+
ulimit -n "$MAX_FD" ||
|
|
160
|
+
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
|
161
|
+
esac
|
|
162
|
+
fi
|
|
163
|
+
|
|
164
|
+
# Collect all arguments for the java command, stacking in reverse order:
|
|
165
|
+
# * args from the command line
|
|
166
|
+
# * the main class name
|
|
167
|
+
# * -classpath
|
|
168
|
+
# * -D...appname settings
|
|
169
|
+
# * --module-path (only if needed)
|
|
170
|
+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
|
171
|
+
|
|
172
|
+
# For Cygwin or MSYS, switch paths to Windows format before running java
|
|
173
|
+
if "$cygwin" || "$msys" ; then
|
|
174
|
+
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
|
175
|
+
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
|
176
|
+
|
|
177
|
+
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
|
178
|
+
|
|
179
|
+
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
|
180
|
+
for arg do
|
|
181
|
+
if
|
|
182
|
+
case $arg in #(
|
|
183
|
+
-*) false ;; # don't mess with options #(
|
|
184
|
+
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
|
185
|
+
[ -e "$t" ] ;; #(
|
|
186
|
+
*) false ;;
|
|
187
|
+
esac
|
|
188
|
+
then
|
|
189
|
+
arg=$( cygpath --path --ignore --mixed "$arg" )
|
|
190
|
+
fi
|
|
191
|
+
# Roll the args list around exactly as many times as the number of
|
|
192
|
+
# args, so each arg winds up back in the position where it started, but
|
|
193
|
+
# possibly modified.
|
|
194
|
+
#
|
|
195
|
+
# NB: a `for` loop captures its iteration list before it begins, so
|
|
196
|
+
# changing the positional parameters here affects neither the number of
|
|
197
|
+
# iterations, nor the values presented in `arg`.
|
|
198
|
+
shift # remove old arg
|
|
199
|
+
set -- "$@" "$arg" # push replacement arg
|
|
200
|
+
done
|
|
201
|
+
fi
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
205
|
+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
|
206
|
+
|
|
207
|
+
# Collect all arguments for the java command:
|
|
208
|
+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
|
209
|
+
# and any embedded shellness will be escaped.
|
|
210
|
+
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
|
211
|
+
# treated as '${Hostname}' itself on the command line.
|
|
212
|
+
|
|
213
|
+
set -- \
|
|
214
|
+
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
|
215
|
+
-classpath "$CLASSPATH" \
|
|
216
|
+
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
|
217
|
+
"$@"
|
|
218
|
+
|
|
219
|
+
# Stop when "xargs" is not available.
|
|
220
|
+
if ! command -v xargs >/dev/null 2>&1
|
|
221
|
+
then
|
|
222
|
+
die "xargs is not available"
|
|
223
|
+
fi
|
|
224
|
+
|
|
225
|
+
# Use "xargs" to parse quoted args.
|
|
226
|
+
#
|
|
227
|
+
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
|
228
|
+
#
|
|
229
|
+
# In Bash we could simply go:
|
|
230
|
+
#
|
|
231
|
+
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
|
232
|
+
# set -- "${ARGS[@]}" "$@"
|
|
233
|
+
#
|
|
234
|
+
# but POSIX shell has neither arrays nor command substitution, so instead we
|
|
235
|
+
# post-process each arg (as a line of input to sed) to backslash-escape any
|
|
236
|
+
# character that might be a shell metacharacter, then use eval to reverse
|
|
237
|
+
# that process (while maintaining the separation between arguments), and wrap
|
|
238
|
+
# the whole thing up as a single "set" statement.
|
|
239
|
+
#
|
|
240
|
+
# This will of course break if any of these variables contains a newline or
|
|
241
|
+
# an unmatched quote.
|
|
242
|
+
#
|
|
243
|
+
|
|
244
|
+
eval "set -- $(
|
|
245
|
+
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
|
246
|
+
xargs -n1 |
|
|
247
|
+
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
|
248
|
+
tr '\n' ' '
|
|
249
|
+
)" '"$@"'
|
|
250
|
+
|
|
251
|
+
exec "$JAVACMD" "$@"
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
@rem
|
|
2
|
+
@rem Copyright 2015 the original author or authors.
|
|
3
|
+
@rem
|
|
4
|
+
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
@rem you may not use this file except in compliance with the License.
|
|
6
|
+
@rem You may obtain a copy of the License at
|
|
7
|
+
@rem
|
|
8
|
+
@rem https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
@rem
|
|
10
|
+
@rem Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
@rem See the License for the specific language governing permissions and
|
|
14
|
+
@rem limitations under the License.
|
|
15
|
+
@rem
|
|
16
|
+
@rem SPDX-License-Identifier: Apache-2.0
|
|
17
|
+
@rem
|
|
18
|
+
|
|
19
|
+
@if "%DEBUG%"=="" @echo off
|
|
20
|
+
@rem ##########################################################################
|
|
21
|
+
@rem
|
|
22
|
+
@rem Gradle startup script for Windows
|
|
23
|
+
@rem
|
|
24
|
+
@rem ##########################################################################
|
|
25
|
+
|
|
26
|
+
@rem Set local scope for the variables with windows NT shell
|
|
27
|
+
if "%OS%"=="Windows_NT" setlocal
|
|
28
|
+
|
|
29
|
+
set DIRNAME=%~dp0
|
|
30
|
+
if "%DIRNAME%"=="" set DIRNAME=.
|
|
31
|
+
@rem This is normally unused
|
|
32
|
+
set APP_BASE_NAME=%~n0
|
|
33
|
+
set APP_HOME=%DIRNAME%
|
|
34
|
+
|
|
35
|
+
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
|
36
|
+
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
|
37
|
+
|
|
38
|
+
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
39
|
+
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
|
40
|
+
|
|
41
|
+
@rem Find java.exe
|
|
42
|
+
if defined JAVA_HOME goto findJavaFromJavaHome
|
|
43
|
+
|
|
44
|
+
set JAVA_EXE=java.exe
|
|
45
|
+
%JAVA_EXE% -version >NUL 2>&1
|
|
46
|
+
if %ERRORLEVEL% equ 0 goto execute
|
|
47
|
+
|
|
48
|
+
echo. 1>&2
|
|
49
|
+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
|
50
|
+
echo. 1>&2
|
|
51
|
+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
|
52
|
+
echo location of your Java installation. 1>&2
|
|
53
|
+
|
|
54
|
+
goto fail
|
|
55
|
+
|
|
56
|
+
:findJavaFromJavaHome
|
|
57
|
+
set JAVA_HOME=%JAVA_HOME:"=%
|
|
58
|
+
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|
59
|
+
|
|
60
|
+
if exist "%JAVA_EXE%" goto execute
|
|
61
|
+
|
|
62
|
+
echo. 1>&2
|
|
63
|
+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
|
64
|
+
echo. 1>&2
|
|
65
|
+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
|
66
|
+
echo location of your Java installation. 1>&2
|
|
67
|
+
|
|
68
|
+
goto fail
|
|
69
|
+
|
|
70
|
+
:execute
|
|
71
|
+
@rem Setup the command line
|
|
72
|
+
|
|
73
|
+
set CLASSPATH=
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
@rem Execute Gradle
|
|
77
|
+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
|
78
|
+
|
|
79
|
+
:end
|
|
80
|
+
@rem End local scope for the variables with windows NT shell
|
|
81
|
+
if %ERRORLEVEL% equ 0 goto mainEnd
|
|
82
|
+
|
|
83
|
+
:fail
|
|
84
|
+
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
|
85
|
+
rem the _cmd.exe /c_ return code!
|
|
86
|
+
set EXIT_CODE=%ERRORLEVEL%
|
|
87
|
+
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
|
88
|
+
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
|
89
|
+
exit /b %EXIT_CODE%
|
|
90
|
+
|
|
91
|
+
:mainEnd
|
|
92
|
+
if "%OS%"=="Windows_NT" endlocal
|
|
93
|
+
|
|
94
|
+
:omega
|
|
@@ -140,6 +140,7 @@ public class RNZoomSDKModule extends ReactContextBaseJavaModule implements ZoomS
|
|
|
140
140
|
initParams.logSize = 5;
|
|
141
141
|
}
|
|
142
142
|
initParams.enableGenerateDump =true;
|
|
143
|
+
initParams.wrapperType = 2;
|
|
143
144
|
|
|
144
145
|
zoomSDK.initialize(reactContext.getCurrentActivity(), RNZoomSDKModule.this, initParams);
|
|
145
146
|
|
|
@@ -164,9 +165,6 @@ public class RNZoomSDKModule extends ReactContextBaseJavaModule implements ZoomS
|
|
|
164
165
|
if (config.hasKey("disableVideoPreview")) {
|
|
165
166
|
meetingSettingsHelper.disableShowVideoPreviewWhenJoinMeeting(config.getBoolean("disableVideoPreview"));
|
|
166
167
|
}
|
|
167
|
-
if (config.hasKey("enableCustomizedMeetingUI")) {
|
|
168
|
-
meetingSettingsHelper.setCustomizedMeetingUIEnabled(config.getBoolean("enableCustomizedMeetingUI"));
|
|
169
|
-
}
|
|
170
168
|
if (config.hasKey("disableClearWebKitCache")) {
|
|
171
169
|
meetingSettingsHelper.disableClearWebKitCache(config.getBoolean("disableClearWebKitCache"));
|
|
172
170
|
}
|
|
@@ -299,6 +297,20 @@ public class RNZoomSDKModule extends ReactContextBaseJavaModule implements ZoomS
|
|
|
299
297
|
});
|
|
300
298
|
}
|
|
301
299
|
|
|
300
|
+
@ReactMethod
|
|
301
|
+
public void cleanup(Promise promise) {
|
|
302
|
+
if (Utils.checkRNActivity(reactContext, promise)) {
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
reactContext.getCurrentActivity().runOnUiThread(new Runnable() {
|
|
306
|
+
@Override
|
|
307
|
+
public void run() {
|
|
308
|
+
ZoomSDK zoomSDK = ZoomSDK.getInstance();
|
|
309
|
+
zoomSDK.uninitialize();
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
|
|
302
314
|
// -----------------------------------------------------------------------------------------------
|
|
303
315
|
// region ZoomSDKInitializeListener
|
|
304
316
|
// -----------------------------------------------------------------------------------------------
|
package/ios/RNZoomSDK.m
CHANGED
|
@@ -37,11 +37,6 @@ RCT_REMAP_METHOD(initSDK,
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
BOOL sdkInitRes = [[MobileRTC sharedRTC] initialize:initParams];
|
|
40
|
-
if (sdkInitRes) {
|
|
41
|
-
NSLog(@"initialize result = true" );
|
|
42
|
-
} else {
|
|
43
|
-
NSLog(@"initialize result = false" );
|
|
44
|
-
}
|
|
45
40
|
|
|
46
41
|
if (sdkInitRes) {
|
|
47
42
|
MobileRTCAuthService *authService = [[MobileRTC sharedRTC] getAuthService];
|
|
@@ -101,7 +96,7 @@ RCT_REMAP_METHOD(joinMeeting,
|
|
|
101
96
|
MobileRTCMeetError res = [meetService joinMeetingWithJoinParam: params];
|
|
102
97
|
switch (res) {
|
|
103
98
|
case MobileRTCMeetError_Success:
|
|
104
|
-
NSLog(@"
|
|
99
|
+
NSLog(@"joinMeeting called");
|
|
105
100
|
resolve(0);
|
|
106
101
|
break;
|
|
107
102
|
default:
|
|
@@ -112,6 +107,14 @@ RCT_REMAP_METHOD(joinMeeting,
|
|
|
112
107
|
});
|
|
113
108
|
}
|
|
114
109
|
|
|
110
|
+
RCT_REMAP_METHOD(isInitialized,
|
|
111
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
112
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
113
|
+
{
|
|
114
|
+
BOOL isInitialized = [[MobileRTC sharedRTC] isRTCAuthorized];
|
|
115
|
+
resolve(@(isInitialized));
|
|
116
|
+
}
|
|
117
|
+
|
|
115
118
|
RCT_REMAP_METHOD(startMeeting,
|
|
116
119
|
startMeetingWithConfig: (NSDictionary *)config
|
|
117
120
|
withResolver: (RCTPromiseResolveBlock)resolve
|
|
@@ -132,7 +135,7 @@ RCT_REMAP_METHOD(startMeeting,
|
|
|
132
135
|
MobileRTCMeetError res = [meetService startMeetingWithStartParam: params];
|
|
133
136
|
switch (res) {
|
|
134
137
|
case MobileRTCMeetError_Success:
|
|
135
|
-
NSLog(@"
|
|
138
|
+
NSLog(@"startMeeting called ");
|
|
136
139
|
resolve(0);
|
|
137
140
|
break;
|
|
138
141
|
default:
|
|
@@ -143,6 +146,31 @@ RCT_REMAP_METHOD(startMeeting,
|
|
|
143
146
|
});
|
|
144
147
|
}
|
|
145
148
|
|
|
149
|
+
RCT_REMAP_METHOD(updateMeetingSetting,
|
|
150
|
+
updateMeetingSettingWithConfig: (NSDictionary *)config
|
|
151
|
+
withResolver: (RCTPromiseResolveBlock)resolve
|
|
152
|
+
withRejecter: (RCTPromiseRejectBlock)reject)
|
|
153
|
+
{
|
|
154
|
+
MobileRTCMeetingSettings *meetingSetting = [[MobileRTC sharedRTC] getMeetingSettings];
|
|
155
|
+
if (meetingSetting) {
|
|
156
|
+
if ([config objectForKey:@"disableVideoPreview"]) {
|
|
157
|
+
[meetingSetting disableShowVideoPreviewWhenJoinMeeting:[[config valueForKey:@"disableVideoPreview"] boolValue]];
|
|
158
|
+
}
|
|
159
|
+
if ([config objectForKey:@"disableClearWebKitCache"]) {
|
|
160
|
+
[meetingSetting disableClearWebKitCache:[[config valueForKey:@"disableClearWebKitCache"] boolValue]];
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
RCT_REMAP_METHOD(cleanup,
|
|
166
|
+
cleanupWithResolver:(RCTPromiseResolveBlock)resolve
|
|
167
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
168
|
+
{
|
|
169
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
170
|
+
[[MobileRTC sharedRTC] cleanup];
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
|
|
146
174
|
- (void)onMobileRTCAuthReturn:(MobileRTCAuthError)returnValue {
|
|
147
175
|
switch (returnValue) {
|
|
148
176
|
case MobileRTCAuthError_Success:
|
package/lib/commonjs/Context.js
CHANGED
|
@@ -12,6 +12,7 @@ const Context = exports.Context = /*#__PURE__*/(0, _react.createContext)({
|
|
|
12
12
|
joinMeeting: throwProviderError,
|
|
13
13
|
startMeeting: throwProviderError,
|
|
14
14
|
updateMeetingSetting: throwProviderError,
|
|
15
|
-
isInitialized: throwProviderError
|
|
15
|
+
isInitialized: throwProviderError,
|
|
16
|
+
cleanup: throwProviderError
|
|
16
17
|
});
|
|
17
18
|
//# sourceMappingURL=Context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","throwProviderError","Error","Context","exports","createContext","joinMeeting","startMeeting","updateMeetingSetting","isInitialized"],"sources":["Context.ts"],"sourcesContent":["import { createContext } from 'react';\nimport type { StartMeetingConfig, JoinMeetingConfig, MeetingSettingsConfig } from './native/ZoomSDK';\n\nfunction throwProviderError() {\n throw new Error(\n 'Cannot access the Zoom SDK without a ZoomSDKProvider component wrapping your entire application.'\n );\n}\n\nexport interface ZoomSDKContext {\n joinMeeting: (config: JoinMeetingConfig) => Promise<number>;\n startMeeting: (config: StartMeetingConfig) => Promise<number>;\n updateMeetingSetting: (config: MeetingSettingsConfig) => void;\n isInitialized: () => Promise<boolean>;\n}\n\nexport const Context = createContext<ZoomSDKContext>({\n joinMeeting: throwProviderError as any,\n startMeeting: throwProviderError as any,\n updateMeetingSetting: throwProviderError as any,\n isInitialized: throwProviderError as any,\n});\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAGA,SAASC,kBAAkBA,CAAA,EAAG;EAC5B,MAAM,IAAIC,KAAK,CACb,kGACF,CAAC;AACH;
|
|
1
|
+
{"version":3,"names":["_react","require","throwProviderError","Error","Context","exports","createContext","joinMeeting","startMeeting","updateMeetingSetting","isInitialized","cleanup"],"sources":["Context.ts"],"sourcesContent":["import { createContext } from 'react';\nimport type { StartMeetingConfig, JoinMeetingConfig, MeetingSettingsConfig } from './native/ZoomSDK';\n\nfunction throwProviderError() {\n throw new Error(\n 'Cannot access the Zoom SDK without a ZoomSDKProvider component wrapping your entire application.'\n );\n}\n\nexport interface ZoomSDKContext {\n joinMeeting: (config: JoinMeetingConfig) => Promise<number>;\n startMeeting: (config: StartMeetingConfig) => Promise<number>;\n updateMeetingSetting: (config: MeetingSettingsConfig) => void;\n isInitialized: () => Promise<boolean>;\n cleanup: () => void;\n}\n\nexport const Context = createContext<ZoomSDKContext>({\n joinMeeting: throwProviderError as any,\n startMeeting: throwProviderError as any,\n updateMeetingSetting: throwProviderError as any,\n isInitialized: throwProviderError as any,\n cleanup: throwProviderError as any,\n});\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAGA,SAASC,kBAAkBA,CAAA,EAAG;EAC5B,MAAM,IAAIC,KAAK,CACb,kGACF,CAAC;AACH;AAUO,MAAMC,OAAO,GAAAC,OAAA,CAAAD,OAAA,gBAAG,IAAAE,oBAAa,EAAiB;EACnDC,WAAW,EAAEL,kBAAyB;EACtCM,YAAY,EAAEN,kBAAyB;EACvCO,oBAAoB,EAAEP,kBAAyB;EAC/CQ,aAAa,EAAER,kBAAyB;EACxCS,OAAO,EAAET;AACX,CAAC,CAAC","ignoreList":[]}
|
|
@@ -35,11 +35,15 @@ function useSDKHandler(config = {}) {
|
|
|
35
35
|
const startMeeting = (0, _react.useCallback)(config => {
|
|
36
36
|
return SDKHandler.current.startMeeting(config);
|
|
37
37
|
}, []);
|
|
38
|
+
const cleanup = (0, _react.useCallback)(() => {
|
|
39
|
+
SDKHandler.current.cleanup();
|
|
40
|
+
}, []);
|
|
38
41
|
return {
|
|
39
42
|
isInitialized,
|
|
40
43
|
updateMeetingSetting,
|
|
41
44
|
joinMeeting,
|
|
42
|
-
startMeeting
|
|
45
|
+
startMeeting,
|
|
46
|
+
cleanup
|
|
43
47
|
};
|
|
44
48
|
}
|
|
45
49
|
//# sourceMappingURL=useSDKHandler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_ZoomSDK","DEFAULT_CONFIG","domain","enableLog","logSize","useSDKHandler","config","SDKHandler","useRef","ZoomSDK","isInited","setIsInited","useState","useEffect","current","initSDK","isInitialized","useCallback","updateMeetingSetting","joinMeeting","startMeeting"],"sources":["useSDKHandler.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\nimport type { ZoomSDKContext } from '../Context';\n\nimport {\n InitConfig,\n MeetingSettingsConfig,\n JoinMeetingConfig,\n StartMeetingConfig,\n ZoomSDK,\n} from '../native/ZoomSDK';\n\nconst DEFAULT_CONFIG: InitConfig = {\n domain: 'zoom.us',\n enableLog: true,\n logSize: 5,\n};\n\nexport function useSDKHandler(config: InitConfig = {}): ZoomSDKContext {\n const SDKHandler = useRef(new ZoomSDK());\n\n const [isInited, setIsInited] = useState(false);\n\n useEffect(() => {\n if (!isInited) {\n SDKHandler.current.initSDK({ ...DEFAULT_CONFIG, ...config });\n setIsInited(true);\n }\n }, [config, isInited]);\n\n const isInitialized = useCallback(() => {\n return SDKHandler.current.isInitialized();\n }, []);\n\n const updateMeetingSetting = useCallback((config: MeetingSettingsConfig) => {\n SDKHandler.current.updateMeetingSetting(config);\n }, []);\n\n const joinMeeting = useCallback((config: JoinMeetingConfig) => {\n return SDKHandler.current.joinMeeting(config);\n }, []);\n\n const startMeeting = useCallback((config: StartMeetingConfig) => {\n return SDKHandler.current.startMeeting(config);\n }, []);\n\n return {\n isInitialized,\n updateMeetingSetting,\n joinMeeting,\n startMeeting,\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAGA,IAAAC,QAAA,GAAAD,OAAA;AAQA,MAAME,cAA0B,GAAG;EACjCC,MAAM,EAAE,SAAS;EACjBC,SAAS,EAAE,IAAI;EACfC,OAAO,EAAE;AACX,CAAC;AAEM,SAASC,aAAaA,CAACC,MAAkB,GAAG,CAAC,CAAC,EAAkB;EACrE,MAAMC,UAAU,GAAG,IAAAC,aAAM,EAAC,IAAIC,gBAAO,CAAC,CAAC,CAAC;EAExC,MAAM,CAACC,QAAQ,EAAEC,WAAW,CAAC,GAAG,IAAAC,eAAQ,EAAC,KAAK,CAAC;EAE/C,IAAAC,gBAAS,EAAC,MAAM;IACd,IAAI,CAACH,QAAQ,EAAE;MACbH,UAAU,CAACO,OAAO,CAACC,OAAO,CAAC;QAAE,GAAGd,cAAc;QAAE,GAAGK;MAAO,CAAC,CAAC;MAC5DK,WAAW,CAAC,IAAI,CAAC;IACnB;EACF,CAAC,EAAE,CAACL,MAAM,EAAEI,QAAQ,CAAC,CAAC;EAEtB,MAAMM,aAAa,GAAG,IAAAC,kBAAW,EAAC,MAAM;IACtC,OAAOV,UAAU,CAACO,OAAO,CAACE,aAAa,CAAC,CAAC;EAC3C,CAAC,EAAE,EAAE,CAAC;EAEN,MAAME,oBAAoB,GAAG,IAAAD,kBAAW,EAAEX,MAA6B,IAAK;IAC1EC,UAAU,CAACO,OAAO,CAACI,oBAAoB,CAACZ,MAAM,CAAC;EACjD,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMa,WAAW,GAAG,IAAAF,kBAAW,EAAEX,MAAyB,IAAK;IAC7D,OAAOC,UAAU,CAACO,OAAO,CAACK,WAAW,CAACb,MAAM,CAAC;EAC/C,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMc,YAAY,GAAG,IAAAH,kBAAW,EAAEX,MAA0B,IAAK;IAC/D,OAAOC,UAAU,CAACO,OAAO,CAACM,YAAY,CAACd,MAAM,CAAC;EAChD,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO;
|
|
1
|
+
{"version":3,"names":["_react","require","_ZoomSDK","DEFAULT_CONFIG","domain","enableLog","logSize","useSDKHandler","config","SDKHandler","useRef","ZoomSDK","isInited","setIsInited","useState","useEffect","current","initSDK","isInitialized","useCallback","updateMeetingSetting","joinMeeting","startMeeting","cleanup"],"sources":["useSDKHandler.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\nimport type { ZoomSDKContext } from '../Context';\n\nimport {\n InitConfig,\n MeetingSettingsConfig,\n JoinMeetingConfig,\n StartMeetingConfig,\n ZoomSDK,\n} from '../native/ZoomSDK';\n\nconst DEFAULT_CONFIG: InitConfig = {\n domain: 'zoom.us',\n enableLog: true,\n logSize: 5,\n};\n\nexport function useSDKHandler(config: InitConfig = {}): ZoomSDKContext {\n const SDKHandler = useRef(new ZoomSDK());\n\n const [isInited, setIsInited] = useState(false);\n\n useEffect(() => {\n if (!isInited) {\n SDKHandler.current.initSDK({ ...DEFAULT_CONFIG, ...config });\n setIsInited(true);\n }\n }, [config, isInited]);\n\n const isInitialized = useCallback(() => {\n return SDKHandler.current.isInitialized();\n }, []);\n\n const updateMeetingSetting = useCallback((config: MeetingSettingsConfig) => {\n SDKHandler.current.updateMeetingSetting(config);\n }, []);\n\n const joinMeeting = useCallback((config: JoinMeetingConfig) => {\n return SDKHandler.current.joinMeeting(config);\n }, []);\n\n const startMeeting = useCallback((config: StartMeetingConfig) => {\n return SDKHandler.current.startMeeting(config);\n }, []);\n\n const cleanup = useCallback(() => {\n SDKHandler.current.cleanup();\n }, []);\n\n return {\n isInitialized,\n updateMeetingSetting,\n joinMeeting,\n startMeeting,\n cleanup\n };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAGA,IAAAC,QAAA,GAAAD,OAAA;AAQA,MAAME,cAA0B,GAAG;EACjCC,MAAM,EAAE,SAAS;EACjBC,SAAS,EAAE,IAAI;EACfC,OAAO,EAAE;AACX,CAAC;AAEM,SAASC,aAAaA,CAACC,MAAkB,GAAG,CAAC,CAAC,EAAkB;EACrE,MAAMC,UAAU,GAAG,IAAAC,aAAM,EAAC,IAAIC,gBAAO,CAAC,CAAC,CAAC;EAExC,MAAM,CAACC,QAAQ,EAAEC,WAAW,CAAC,GAAG,IAAAC,eAAQ,EAAC,KAAK,CAAC;EAE/C,IAAAC,gBAAS,EAAC,MAAM;IACd,IAAI,CAACH,QAAQ,EAAE;MACbH,UAAU,CAACO,OAAO,CAACC,OAAO,CAAC;QAAE,GAAGd,cAAc;QAAE,GAAGK;MAAO,CAAC,CAAC;MAC5DK,WAAW,CAAC,IAAI,CAAC;IACnB;EACF,CAAC,EAAE,CAACL,MAAM,EAAEI,QAAQ,CAAC,CAAC;EAEtB,MAAMM,aAAa,GAAG,IAAAC,kBAAW,EAAC,MAAM;IACtC,OAAOV,UAAU,CAACO,OAAO,CAACE,aAAa,CAAC,CAAC;EAC3C,CAAC,EAAE,EAAE,CAAC;EAEN,MAAME,oBAAoB,GAAG,IAAAD,kBAAW,EAAEX,MAA6B,IAAK;IAC1EC,UAAU,CAACO,OAAO,CAACI,oBAAoB,CAACZ,MAAM,CAAC;EACjD,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMa,WAAW,GAAG,IAAAF,kBAAW,EAAEX,MAAyB,IAAK;IAC7D,OAAOC,UAAU,CAACO,OAAO,CAACK,WAAW,CAACb,MAAM,CAAC;EAC/C,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMc,YAAY,GAAG,IAAAH,kBAAW,EAAEX,MAA0B,IAAK;IAC/D,OAAOC,UAAU,CAACO,OAAO,CAACM,YAAY,CAACd,MAAM,CAAC;EAChD,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMe,OAAO,GAAG,IAAAJ,kBAAW,EAAC,MAAM;IAChCV,UAAU,CAACO,OAAO,CAACO,OAAO,CAAC,CAAC;EAC9B,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO;IACLL,aAAa;IACbE,oBAAoB;IACpBC,WAAW;IACXC,YAAY;IACZC;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -16,6 +16,7 @@ class ZoomSDK {
|
|
|
16
16
|
constructor() {
|
|
17
17
|
_defineProperty(this, "updateMeetingSetting", RNZoomSDK.updateMeetingSetting);
|
|
18
18
|
_defineProperty(this, "isInitialized", RNZoomSDK.isInitialized);
|
|
19
|
+
_defineProperty(this, "cleanup", RNZoomSDK.cleanup);
|
|
19
20
|
}
|
|
20
21
|
initSDK(config) {
|
|
21
22
|
(0, _validation.validateNonEmptyStringProp)(config, 'initConfig', 'domain');
|
|
@@ -23,13 +24,13 @@ class ZoomSDK {
|
|
|
23
24
|
return RNZoomSDK.initSDK(config);
|
|
24
25
|
}
|
|
25
26
|
joinMeeting(config) {
|
|
26
|
-
(0, _validation.
|
|
27
|
-
(0, _validation.
|
|
27
|
+
(0, _validation.validateRequiredStringProp)(config, 'JoinMeetingConfig', 'userName');
|
|
28
|
+
(0, _validation.validateRequiredStringProp)(config, 'JoinMeetingConfig', 'meetingNumber');
|
|
28
29
|
return RNZoomSDK.joinMeeting(config);
|
|
29
30
|
}
|
|
30
31
|
startMeeting(config) {
|
|
31
|
-
(0, _validation.
|
|
32
|
-
(0, _validation.
|
|
32
|
+
(0, _validation.validateRequiredStringProp)(config, 'StartMeetingConfig', 'userName');
|
|
33
|
+
(0, _validation.validateRequiredStringProp)(config, 'StartMeetingConfig', 'zoomAccessToken');
|
|
33
34
|
return RNZoomSDK.startMeeting(config);
|
|
34
35
|
}
|
|
35
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_validation","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","RNZoomSDK","NativeModules","ZoomSDK","constructor","updateMeetingSetting","isInitialized","initSDK","config","validateNonEmptyStringProp","validateBooleanProp","joinMeeting","startMeeting","exports"],"sources":["ZoomSDK.ts"],"sourcesContent":["import { NativeModules } from 'react-native';\nimport {\n validateNonEmptyStringProp,\n validateBooleanProp,\n} from '../utils/validation';\n\nconst { RNZoomSDK } = NativeModules;\n\nexport type InitConfig = {\n jwtToken?: string;\n domain?: string;\n enableLog?: boolean;\n logSize?: number; //Android only\n bundleResPath?: string; //iOS only\n appGroupId?: string; //iOS only\n replaykitBundleIdentifier?: string; //iOS only\n};\n\nexport type MeetingSettingsConfig = {\n disableVideoPreview?: boolean;\n
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_validation","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","RNZoomSDK","NativeModules","ZoomSDK","constructor","updateMeetingSetting","isInitialized","cleanup","initSDK","config","validateNonEmptyStringProp","validateBooleanProp","joinMeeting","validateRequiredStringProp","startMeeting","exports"],"sources":["ZoomSDK.ts"],"sourcesContent":["import { NativeModules } from 'react-native';\nimport {\n validateNonEmptyStringProp,\n validateRequiredStringProp,\n validateBooleanProp,\n} from '../utils/validation';\n\nconst { RNZoomSDK } = NativeModules;\n\nexport type InitConfig = {\n jwtToken?: string;\n domain?: string;\n enableLog?: boolean;\n logSize?: number; //Android only\n bundleResPath?: string; //iOS only\n appGroupId?: string; //iOS only\n replaykitBundleIdentifier?: string; //iOS only\n};\n\nexport type MeetingSettingsConfig = {\n disableVideoPreview?: boolean;\n disableClearWebKitCache?: boolean;\n language?: string; //Android only\n};\n\nexport type JoinMeetingConfig = {\n userName: string;\n meetingNumber: string;\n password?: string;\n zoomAccessToken?: string;\n vanityID?: string;\n webinarToken?: string;\n joinToken?: string;\n appPrivilegeToken?: string;\n isMyVoiceInMix?: boolean;\n isAudioRawDataStereo?: boolean;\n\n noDrivingMode?: boolean;\n noInvite?: boolean;\n noMeetingEndMessage?: boolean;\n noMeetingErrorMessage?: boolean;\n noTitleBar?: boolean;\n noBottomToolbar?: boolean;\n noPhoneDialIn?: boolean;\n noPhoneDialOut?: boolean;\n noRecord?: boolean;\n noShare?: boolean;\n noVideo?: boolean;\n inviteOptions?: number;\n customerKey?: string;\n customMeetingId?: string;\n noUnmuteConfirmDialog?: boolean;\n noWebinarRegisterDialog?: boolean;\n noChatMsgToast?: boolean;\n noAudio?: boolean;\n meetingViewsOptions?: string;\n userType?: number;\n};\n\nexport type StartMeetingConfig = {\n userName: string;\n meetingNumber?: string;\n userType?: number;\n inviteContactId?: string;\n zoomAccessToken: string;\n vanityID?: string;\n isMyVoiceInMix?: boolean;\n isAudioRawDataStereo?: boolean;\n\n noDrivingMode?: boolean;\n noInvite?: boolean;\n noMeetingEndMessage?: boolean;\n noMeetingErrorMessage?: boolean;\n noTitleBar?: boolean;\n noBottomToolbar?: boolean;\n noPhoneDialIn?: boolean;\n noPhoneDialOut?: boolean;\n noRecord?: boolean;\n noShare?: boolean;\n noVideo?: boolean;\n inviteOptions?: number;\n customerKey?: string;\n customMeetingId?: string;\n noUnmuteConfirmDialog?: boolean;\n noWebinarRegisterDialog?: boolean;\n noChatMsgToast?: boolean;\n noAudio?: boolean;\n meetingViewsOptions?: string;\n};\n\nexport type ZoomSDKType = {\n // Methods\n initSDK: (config: InitConfig) => Promise<boolean>;\n joinMeeting: (config: JoinMeetingConfig) => Promise<number>;\n startMeeting: (config: StartMeetingConfig) => Promise<number>;\n updateMeetingSetting: (config: MeetingSettingsConfig) => void;\n isInitialized: () => Promise<boolean>;\n cleanup: () => void;\n};\n\nexport class ZoomSDK implements ZoomSDKType {\n initSDK(config: InitConfig) {\n validateNonEmptyStringProp(config, 'initConfig', 'domain');\n validateBooleanProp(config, 'initConfig', 'enableLog');\n return RNZoomSDK.initSDK(config);\n }\n\n joinMeeting(config: JoinMeetingConfig) {\n validateRequiredStringProp(config, 'JoinMeetingConfig', 'userName');\n validateRequiredStringProp(config, 'JoinMeetingConfig', 'meetingNumber');\n return RNZoomSDK.joinMeeting(config);\n }\n\n startMeeting(config: StartMeetingConfig) {\n validateRequiredStringProp(config, 'StartMeetingConfig', 'userName');\n validateRequiredStringProp(config, 'StartMeetingConfig', 'zoomAccessToken');\n return RNZoomSDK.startMeeting(config);\n }\n\n updateMeetingSetting = RNZoomSDK.updateMeetingSetting;\n isInitialized = RNZoomSDK.isInitialized;\n cleanup = RNZoomSDK.cleanup;\n}"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAI6B,SAAAE,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAD,CAAA,GAAAI,MAAA,CAAAC,cAAA,CAAAL,CAAA,EAAAC,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAT,CAAA,CAAAC,CAAA,IAAAC,CAAA,EAAAF,CAAA;AAAA,SAAAG,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAF,CAAA,GAAAE,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAb,CAAA,QAAAU,CAAA,GAAAV,CAAA,CAAAc,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,CAAA;AAE7B,MAAM;EAAEgB;AAAU,CAAC,GAAGC,0BAAa;AA6F5B,MAAMC,OAAO,CAAwB;EAAAC,YAAA;IAAAtB,eAAA,+BAmBnBmB,SAAS,CAACI,oBAAoB;IAAAvB,eAAA,wBACrCmB,SAAS,CAACK,aAAa;IAAAxB,eAAA,kBAC7BmB,SAAS,CAACM,OAAO;EAAA;EApB3BC,OAAOA,CAACC,MAAkB,EAAE;IAC1B,IAAAC,sCAA0B,EAACD,MAAM,EAAE,YAAY,EAAE,QAAQ,CAAC;IAC1D,IAAAE,+BAAmB,EAACF,MAAM,EAAE,YAAY,EAAE,WAAW,CAAC;IACtD,OAAOR,SAAS,CAACO,OAAO,CAACC,MAAM,CAAC;EAClC;EAEAG,WAAWA,CAACH,MAAyB,EAAE;IACrC,IAAAI,sCAA0B,EAACJ,MAAM,EAAE,mBAAmB,EAAE,UAAU,CAAC;IACnE,IAAAI,sCAA0B,EAACJ,MAAM,EAAE,mBAAmB,EAAE,eAAe,CAAC;IACxE,OAAOR,SAAS,CAACW,WAAW,CAACH,MAAM,CAAC;EACtC;EAEAK,YAAYA,CAACL,MAA0B,EAAE;IACvC,IAAAI,sCAA0B,EAACJ,MAAM,EAAE,oBAAoB,EAAE,UAAU,CAAC;IACpE,IAAAI,sCAA0B,EAACJ,MAAM,EAAE,oBAAoB,EAAE,iBAAiB,CAAC;IAC3E,OAAOR,SAAS,CAACa,YAAY,CAACL,MAAM,CAAC;EACvC;AAKF;AAACM,OAAA,CAAAZ,OAAA,GAAAA,OAAA","ignoreList":[]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.validateNonEmptyStringProp = exports.validateBooleanProp = void 0;
|
|
6
|
+
exports.validateRequiredStringProp = exports.validateNonEmptyStringProp = exports.validateBooleanProp = void 0;
|
|
7
7
|
var _assert = _interopRequireDefault(require("assert"));
|
|
8
8
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
9
|
const validateNonEmptyStringProp = (config, errorLabel, propName) => {
|
|
@@ -14,6 +14,13 @@ const validateNonEmptyStringProp = (config, errorLabel, propName) => {
|
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
16
|
exports.validateNonEmptyStringProp = validateNonEmptyStringProp;
|
|
17
|
+
const validateRequiredStringProp = (config, errorLabel, propName) => {
|
|
18
|
+
const prop = config[propName];
|
|
19
|
+
_assert.default.ok(typeof prop !== 'undefined' && prop !== null, `${errorLabel}: ${propName} is required`);
|
|
20
|
+
_assert.default.strictEqual(typeof prop, 'string', `${errorLabel}: ${propName} must be a string`);
|
|
21
|
+
_assert.default.ok(prop.length > 0, `${errorLabel}: ${propName} must have more then 0 characters`);
|
|
22
|
+
};
|
|
23
|
+
exports.validateRequiredStringProp = validateRequiredStringProp;
|
|
17
24
|
const validateBooleanProp = (config, errorLabel, propName) => {
|
|
18
25
|
const prop = config[propName];
|
|
19
26
|
if (typeof prop !== 'undefined') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_assert","_interopRequireDefault","require","e","__esModule","default","validateNonEmptyStringProp","config","errorLabel","propName","prop","assert","strictEqual","ok","length","exports","validateBooleanProp"],"sources":["validation.ts"],"sourcesContent":["import assert from 'assert';\n\nexport const validateNonEmptyStringProp = (\n config: any,\n errorLabel: string,\n propName: string\n) => {\n const prop = config[propName];\n if (typeof prop !== 'undefined') {\n assert.strictEqual(\n typeof prop,\n 'string',\n `${errorLabel}: ${propName} must be a string`\n );\n\n assert.ok(\n prop.length > 0,\n `${errorLabel}: ${propName} must have more then 0 characters`\n );\n }\n};\n\nexport const validateBooleanProp = (\n config: any,\n errorLabel: string,\n propName: string\n) => {\n const prop = config[propName];\n if (typeof prop !== 'undefined') {\n assert.strictEqual(\n typeof prop,\n 'boolean',\n `${errorLabel}: ${propName} must be a boolean`\n );\n }\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA4B,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAErB,MAAMG,0BAA0B,GAAGA,CACxCC,MAAW,EACXC,UAAkB,EAClBC,QAAgB,KACb;EACH,MAAMC,IAAI,GAAGH,MAAM,CAACE,QAAQ,CAAC;EAC7B,IAAI,OAAOC,IAAI,KAAK,WAAW,EAAE;IAC/BC,eAAM,CAACC,WAAW,CAChB,OAAOF,IAAI,EACX,QAAQ,EACR,GAAGF,UAAU,KAAKC,QAAQ,mBAC5B,CAAC;IAEDE,eAAM,CAACE,EAAE,CACPH,IAAI,CAACI,MAAM,GAAG,CAAC,EACf,GAAGN,UAAU,KAAKC,QAAQ,mCAC5B,CAAC;EACH;AACF,CAAC;AAACM,OAAA,CAAAT,0BAAA,GAAAA,0BAAA;AAEK,MAAMU,mBAAmB,GAAGA,
|
|
1
|
+
{"version":3,"names":["_assert","_interopRequireDefault","require","e","__esModule","default","validateNonEmptyStringProp","config","errorLabel","propName","prop","assert","strictEqual","ok","length","exports","validateRequiredStringProp","validateBooleanProp"],"sources":["validation.ts"],"sourcesContent":["import assert from 'assert';\n\nexport const validateNonEmptyStringProp = (\n config: any,\n errorLabel: string,\n propName: string\n) => {\n const prop = config[propName];\n if (typeof prop !== 'undefined') {\n assert.strictEqual(\n typeof prop,\n 'string',\n `${errorLabel}: ${propName} must be a string`\n );\n\n assert.ok(\n prop.length > 0,\n `${errorLabel}: ${propName} must have more then 0 characters`\n );\n }\n};\n\nexport const validateRequiredStringProp = (\n config: any,\n errorLabel: string,\n propName: string\n) => {\n const prop = config[propName];\n \n assert.ok(\n typeof prop !== 'undefined' && prop !== null,\n `${errorLabel}: ${propName} is required`\n );\n \n assert.strictEqual(\n typeof prop,\n 'string',\n `${errorLabel}: ${propName} must be a string`\n );\n\n assert.ok(\n prop.length > 0,\n `${errorLabel}: ${propName} must have more then 0 characters`\n );\n};\n\nexport const validateBooleanProp = (\n config: any,\n errorLabel: string,\n propName: string\n) => {\n const prop = config[propName];\n if (typeof prop !== 'undefined') {\n assert.strictEqual(\n typeof prop,\n 'boolean',\n `${errorLabel}: ${propName} must be a boolean`\n );\n }\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA4B,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAErB,MAAMG,0BAA0B,GAAGA,CACxCC,MAAW,EACXC,UAAkB,EAClBC,QAAgB,KACb;EACH,MAAMC,IAAI,GAAGH,MAAM,CAACE,QAAQ,CAAC;EAC7B,IAAI,OAAOC,IAAI,KAAK,WAAW,EAAE;IAC/BC,eAAM,CAACC,WAAW,CAChB,OAAOF,IAAI,EACX,QAAQ,EACR,GAAGF,UAAU,KAAKC,QAAQ,mBAC5B,CAAC;IAEDE,eAAM,CAACE,EAAE,CACPH,IAAI,CAACI,MAAM,GAAG,CAAC,EACf,GAAGN,UAAU,KAAKC,QAAQ,mCAC5B,CAAC;EACH;AACF,CAAC;AAACM,OAAA,CAAAT,0BAAA,GAAAA,0BAAA;AAEK,MAAMU,0BAA0B,GAAGA,CACxCT,MAAW,EACXC,UAAkB,EAClBC,QAAgB,KACb;EACH,MAAMC,IAAI,GAAGH,MAAM,CAACE,QAAQ,CAAC;EAE7BE,eAAM,CAACE,EAAE,CACP,OAAOH,IAAI,KAAK,WAAW,IAAIA,IAAI,KAAK,IAAI,EAC5C,GAAGF,UAAU,KAAKC,QAAQ,cAC5B,CAAC;EAEDE,eAAM,CAACC,WAAW,CAChB,OAAOF,IAAI,EACX,QAAQ,EACR,GAAGF,UAAU,KAAKC,QAAQ,mBAC5B,CAAC;EAEDE,eAAM,CAACE,EAAE,CACPH,IAAI,CAACI,MAAM,GAAG,CAAC,EACf,GAAGN,UAAU,KAAKC,QAAQ,mCAC5B,CAAC;AACH,CAAC;AAACM,OAAA,CAAAC,0BAAA,GAAAA,0BAAA;AAEK,MAAMC,mBAAmB,GAAGA,CACjCV,MAAW,EACXC,UAAkB,EAClBC,QAAgB,KACb;EACH,MAAMC,IAAI,GAAGH,MAAM,CAACE,QAAQ,CAAC;EAC7B,IAAI,OAAOC,IAAI,KAAK,WAAW,EAAE;IAC/BC,eAAM,CAACC,WAAW,CAChB,OAAOF,IAAI,EACX,SAAS,EACT,GAAGF,UAAU,KAAKC,QAAQ,oBAC5B,CAAC;EACH;AACF,CAAC;AAACM,OAAA,CAAAE,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
package/lib/module/Context.js
CHANGED
|
@@ -6,6 +6,7 @@ export const Context = /*#__PURE__*/createContext({
|
|
|
6
6
|
joinMeeting: throwProviderError,
|
|
7
7
|
startMeeting: throwProviderError,
|
|
8
8
|
updateMeetingSetting: throwProviderError,
|
|
9
|
-
isInitialized: throwProviderError
|
|
9
|
+
isInitialized: throwProviderError,
|
|
10
|
+
cleanup: throwProviderError
|
|
10
11
|
});
|
|
11
12
|
//# sourceMappingURL=Context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createContext","throwProviderError","Error","Context","joinMeeting","startMeeting","updateMeetingSetting","isInitialized"],"sources":["Context.ts"],"sourcesContent":["import { createContext } from 'react';\nimport type { StartMeetingConfig, JoinMeetingConfig, MeetingSettingsConfig } from './native/ZoomSDK';\n\nfunction throwProviderError() {\n throw new Error(\n 'Cannot access the Zoom SDK without a ZoomSDKProvider component wrapping your entire application.'\n );\n}\n\nexport interface ZoomSDKContext {\n joinMeeting: (config: JoinMeetingConfig) => Promise<number>;\n startMeeting: (config: StartMeetingConfig) => Promise<number>;\n updateMeetingSetting: (config: MeetingSettingsConfig) => void;\n isInitialized: () => Promise<boolean>;\n}\n\nexport const Context = createContext<ZoomSDKContext>({\n joinMeeting: throwProviderError as any,\n startMeeting: throwProviderError as any,\n updateMeetingSetting: throwProviderError as any,\n isInitialized: throwProviderError as any,\n});\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,OAAO;AAGrC,SAASC,kBAAkBA,CAAA,EAAG;EAC5B,MAAM,IAAIC,KAAK,CACb,kGACF,CAAC;AACH;
|
|
1
|
+
{"version":3,"names":["createContext","throwProviderError","Error","Context","joinMeeting","startMeeting","updateMeetingSetting","isInitialized","cleanup"],"sources":["Context.ts"],"sourcesContent":["import { createContext } from 'react';\nimport type { StartMeetingConfig, JoinMeetingConfig, MeetingSettingsConfig } from './native/ZoomSDK';\n\nfunction throwProviderError() {\n throw new Error(\n 'Cannot access the Zoom SDK without a ZoomSDKProvider component wrapping your entire application.'\n );\n}\n\nexport interface ZoomSDKContext {\n joinMeeting: (config: JoinMeetingConfig) => Promise<number>;\n startMeeting: (config: StartMeetingConfig) => Promise<number>;\n updateMeetingSetting: (config: MeetingSettingsConfig) => void;\n isInitialized: () => Promise<boolean>;\n cleanup: () => void;\n}\n\nexport const Context = createContext<ZoomSDKContext>({\n joinMeeting: throwProviderError as any,\n startMeeting: throwProviderError as any,\n updateMeetingSetting: throwProviderError as any,\n isInitialized: throwProviderError as any,\n cleanup: throwProviderError as any,\n});\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,OAAO;AAGrC,SAASC,kBAAkBA,CAAA,EAAG;EAC5B,MAAM,IAAIC,KAAK,CACb,kGACF,CAAC;AACH;AAUA,OAAO,MAAMC,OAAO,gBAAGH,aAAa,CAAiB;EACnDI,WAAW,EAAEH,kBAAyB;EACtCI,YAAY,EAAEJ,kBAAyB;EACvCK,oBAAoB,EAAEL,kBAAyB;EAC/CM,aAAa,EAAEN,kBAAyB;EACxCO,OAAO,EAAEP;AACX,CAAC,CAAC","ignoreList":[]}
|
|
@@ -29,11 +29,15 @@ export function useSDKHandler(config = {}) {
|
|
|
29
29
|
const startMeeting = useCallback(config => {
|
|
30
30
|
return SDKHandler.current.startMeeting(config);
|
|
31
31
|
}, []);
|
|
32
|
+
const cleanup = useCallback(() => {
|
|
33
|
+
SDKHandler.current.cleanup();
|
|
34
|
+
}, []);
|
|
32
35
|
return {
|
|
33
36
|
isInitialized,
|
|
34
37
|
updateMeetingSetting,
|
|
35
38
|
joinMeeting,
|
|
36
|
-
startMeeting
|
|
39
|
+
startMeeting,
|
|
40
|
+
cleanup
|
|
37
41
|
};
|
|
38
42
|
}
|
|
39
43
|
//# sourceMappingURL=useSDKHandler.js.map
|