@zoom/meetingsdk-react-native 6.4.10 → 6.7.2
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 +57 -52
- package/android/gradle/verification-metadata.xml +3769 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/android/gradle.properties +4 -4
- package/android/gradlew +251 -0
- package/android/gradlew.bat +94 -0
- package/android/src/main/java/com/reactnativezoom/sdk/RNZoomSDKModule.java +15 -3
- package/android/versions.gradle +318 -0
- package/ios/RNZoomSDK.m +37 -9
- 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 +2 -2
- 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
|
@@ -2,7 +2,7 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
|
|
|
2
2
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
3
3
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
4
4
|
import { NativeModules } from 'react-native';
|
|
5
|
-
import { validateNonEmptyStringProp, validateBooleanProp } from '../utils/validation';
|
|
5
|
+
import { validateNonEmptyStringProp, validateRequiredStringProp, validateBooleanProp } from '../utils/validation';
|
|
6
6
|
const {
|
|
7
7
|
RNZoomSDK
|
|
8
8
|
} = NativeModules;
|
|
@@ -10,6 +10,7 @@ export class ZoomSDK {
|
|
|
10
10
|
constructor() {
|
|
11
11
|
_defineProperty(this, "updateMeetingSetting", RNZoomSDK.updateMeetingSetting);
|
|
12
12
|
_defineProperty(this, "isInitialized", RNZoomSDK.isInitialized);
|
|
13
|
+
_defineProperty(this, "cleanup", RNZoomSDK.cleanup);
|
|
13
14
|
}
|
|
14
15
|
initSDK(config) {
|
|
15
16
|
validateNonEmptyStringProp(config, 'initConfig', 'domain');
|
|
@@ -17,13 +18,13 @@ export class ZoomSDK {
|
|
|
17
18
|
return RNZoomSDK.initSDK(config);
|
|
18
19
|
}
|
|
19
20
|
joinMeeting(config) {
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
validateRequiredStringProp(config, 'JoinMeetingConfig', 'userName');
|
|
22
|
+
validateRequiredStringProp(config, 'JoinMeetingConfig', 'meetingNumber');
|
|
22
23
|
return RNZoomSDK.joinMeeting(config);
|
|
23
24
|
}
|
|
24
25
|
startMeeting(config) {
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
validateRequiredStringProp(config, 'StartMeetingConfig', 'userName');
|
|
27
|
+
validateRequiredStringProp(config, 'StartMeetingConfig', 'zoomAccessToken');
|
|
27
28
|
return RNZoomSDK.startMeeting(config);
|
|
28
29
|
}
|
|
29
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","validateNonEmptyStringProp","validateBooleanProp","RNZoomSDK","ZoomSDK","constructor","_defineProperty","updateMeetingSetting","isInitialized","initSDK","config","joinMeeting","startMeeting"],"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":["NativeModules","validateNonEmptyStringProp","validateRequiredStringProp","validateBooleanProp","RNZoomSDK","ZoomSDK","constructor","_defineProperty","updateMeetingSetting","isInitialized","cleanup","initSDK","config","joinMeeting","startMeeting"],"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,SAASA,aAAa,QAAQ,cAAc;AAC5C,SACEC,0BAA0B,EAC1BC,0BAA0B,EAC1BC,mBAAmB,QACd,qBAAqB;AAE5B,MAAM;EAAEC;AAAU,CAAC,GAAGJ,aAAa;AA6FnC,OAAO,MAAMK,OAAO,CAAwB;EAAAC,YAAA;IAAAC,eAAA,+BAmBnBH,SAAS,CAACI,oBAAoB;IAAAD,eAAA,wBACrCH,SAAS,CAACK,aAAa;IAAAF,eAAA,kBAC7BH,SAAS,CAACM,OAAO;EAAA;EApB3BC,OAAOA,CAACC,MAAkB,EAAE;IAC1BX,0BAA0B,CAACW,MAAM,EAAE,YAAY,EAAE,QAAQ,CAAC;IAC1DT,mBAAmB,CAACS,MAAM,EAAE,YAAY,EAAE,WAAW,CAAC;IACtD,OAAOR,SAAS,CAACO,OAAO,CAACC,MAAM,CAAC;EAClC;EAEAC,WAAWA,CAACD,MAAyB,EAAE;IACrCV,0BAA0B,CAACU,MAAM,EAAE,mBAAmB,EAAE,UAAU,CAAC;IACnEV,0BAA0B,CAACU,MAAM,EAAE,mBAAmB,EAAE,eAAe,CAAC;IACxE,OAAOR,SAAS,CAACS,WAAW,CAACD,MAAM,CAAC;EACtC;EAEAE,YAAYA,CAACF,MAA0B,EAAE;IACvCV,0BAA0B,CAACU,MAAM,EAAE,oBAAoB,EAAE,UAAU,CAAC;IACpEV,0BAA0B,CAACU,MAAM,EAAE,oBAAoB,EAAE,iBAAiB,CAAC;IAC3E,OAAOR,SAAS,CAACU,YAAY,CAACF,MAAM,CAAC;EACvC;AAKF","ignoreList":[]}
|
|
@@ -6,6 +6,12 @@ export const validateNonEmptyStringProp = (config, errorLabel, propName) => {
|
|
|
6
6
|
assert.ok(prop.length > 0, `${errorLabel}: ${propName} must have more then 0 characters`);
|
|
7
7
|
}
|
|
8
8
|
};
|
|
9
|
+
export const validateRequiredStringProp = (config, errorLabel, propName) => {
|
|
10
|
+
const prop = config[propName];
|
|
11
|
+
assert.ok(typeof prop !== 'undefined' && prop !== null, `${errorLabel}: ${propName} is required`);
|
|
12
|
+
assert.strictEqual(typeof prop, 'string', `${errorLabel}: ${propName} must be a string`);
|
|
13
|
+
assert.ok(prop.length > 0, `${errorLabel}: ${propName} must have more then 0 characters`);
|
|
14
|
+
};
|
|
9
15
|
export const validateBooleanProp = (config, errorLabel, propName) => {
|
|
10
16
|
const prop = config[propName];
|
|
11
17
|
if (typeof prop !== 'undefined') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["assert","validateNonEmptyStringProp","config","errorLabel","propName","prop","strictEqual","ok","length","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,OAAOA,MAAM,MAAM,QAAQ;AAE3B,OAAO,MAAMC,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/BL,MAAM,CAACM,WAAW,CAChB,OAAOD,IAAI,EACX,QAAQ,EACR,GAAGF,UAAU,KAAKC,QAAQ,mBAC5B,CAAC;IAEDJ,MAAM,CAACO,EAAE,CACPF,IAAI,CAACG,MAAM,GAAG,CAAC,EACf,GAAGL,UAAU,KAAKC,QAAQ,mCAC5B,CAAC;EACH;AACF,CAAC;AAED,OAAO,MAAMK,mBAAmB,GAAGA,
|
|
1
|
+
{"version":3,"names":["assert","validateNonEmptyStringProp","config","errorLabel","propName","prop","strictEqual","ok","length","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,OAAOA,MAAM,MAAM,QAAQ;AAE3B,OAAO,MAAMC,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/BL,MAAM,CAACM,WAAW,CAChB,OAAOD,IAAI,EACX,QAAQ,EACR,GAAGF,UAAU,KAAKC,QAAQ,mBAC5B,CAAC;IAEDJ,MAAM,CAACO,EAAE,CACPF,IAAI,CAACG,MAAM,GAAG,CAAC,EACf,GAAGL,UAAU,KAAKC,QAAQ,mCAC5B,CAAC;EACH;AACF,CAAC;AAED,OAAO,MAAMK,0BAA0B,GAAGA,CACxCP,MAAW,EACXC,UAAkB,EAClBC,QAAgB,KACb;EACH,MAAMC,IAAI,GAAGH,MAAM,CAACE,QAAQ,CAAC;EAE7BJ,MAAM,CAACO,EAAE,CACP,OAAOF,IAAI,KAAK,WAAW,IAAIA,IAAI,KAAK,IAAI,EAC5C,GAAGF,UAAU,KAAKC,QAAQ,cAC5B,CAAC;EAEDJ,MAAM,CAACM,WAAW,CAChB,OAAOD,IAAI,EACX,QAAQ,EACR,GAAGF,UAAU,KAAKC,QAAQ,mBAC5B,CAAC;EAEDJ,MAAM,CAACO,EAAE,CACPF,IAAI,CAACG,MAAM,GAAG,CAAC,EACf,GAAGL,UAAU,KAAKC,QAAQ,mCAC5B,CAAC;AACH,CAAC;AAED,OAAO,MAAMM,mBAAmB,GAAGA,CACjCR,MAAW,EACXC,UAAkB,EAClBC,QAAgB,KACb;EACH,MAAMC,IAAI,GAAGH,MAAM,CAACE,QAAQ,CAAC;EAC7B,IAAI,OAAOC,IAAI,KAAK,WAAW,EAAE;IAC/BL,MAAM,CAACM,WAAW,CAChB,OAAOD,IAAI,EACX,SAAS,EACT,GAAGF,UAAU,KAAKC,QAAQ,oBAC5B,CAAC;EACH;AACF,CAAC","ignoreList":[]}
|
|
@@ -5,5 +5,6 @@ export interface ZoomSDKContext {
|
|
|
5
5
|
startMeeting: (config: StartMeetingConfig) => Promise<number>;
|
|
6
6
|
updateMeetingSetting: (config: MeetingSettingsConfig) => void;
|
|
7
7
|
isInitialized: () => Promise<boolean>;
|
|
8
|
+
cleanup: () => void;
|
|
8
9
|
}
|
|
9
10
|
export declare const Context: import("react").Context<ZoomSDKContext>;
|
|
@@ -9,7 +9,6 @@ export declare type InitConfig = {
|
|
|
9
9
|
};
|
|
10
10
|
export declare type MeetingSettingsConfig = {
|
|
11
11
|
disableVideoPreview?: boolean;
|
|
12
|
-
enableCustomizedMeetingUI?: boolean;
|
|
13
12
|
disableClearWebKitCache?: boolean;
|
|
14
13
|
language?: string;
|
|
15
14
|
};
|
|
@@ -80,6 +79,7 @@ export declare type ZoomSDKType = {
|
|
|
80
79
|
startMeeting: (config: StartMeetingConfig) => Promise<number>;
|
|
81
80
|
updateMeetingSetting: (config: MeetingSettingsConfig) => void;
|
|
82
81
|
isInitialized: () => Promise<boolean>;
|
|
82
|
+
cleanup: () => void;
|
|
83
83
|
};
|
|
84
84
|
export declare class ZoomSDK implements ZoomSDKType {
|
|
85
85
|
initSDK(config: InitConfig): any;
|
|
@@ -87,4 +87,5 @@ export declare class ZoomSDK implements ZoomSDKType {
|
|
|
87
87
|
startMeeting(config: StartMeetingConfig): any;
|
|
88
88
|
updateMeetingSetting: any;
|
|
89
89
|
isInitialized: any;
|
|
90
|
+
cleanup: any;
|
|
90
91
|
}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export declare const validateNonEmptyStringProp: (config: any, errorLabel: string, propName: string) => void;
|
|
2
|
+
export declare const validateRequiredStringProp: (config: any, errorLabel: string, propName: string) => void;
|
|
2
3
|
export declare const validateBooleanProp: (config: any, errorLabel: string, propName: string) => void;
|
|
@@ -16,8 +16,8 @@ Pod::Spec.new do |s|
|
|
|
16
16
|
s.source_files = "ios/**/*.{h,m,mm}"
|
|
17
17
|
s.dependency "React-Core"
|
|
18
18
|
|
|
19
|
-
s.dependency "ZoomMeetingSDK", '6.
|
|
19
|
+
s.dependency "ZoomMeetingSDK", '6.7.2'
|
|
20
20
|
|
|
21
|
-
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386
|
|
21
|
+
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
|
|
22
22
|
s.preserve_paths = ['MobileRTC.xcframework/**/*', 'zoomcml.xcframework/**/*']
|
|
23
23
|
end
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zoom/meetingsdk-react-native",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.7.2",
|
|
4
4
|
"description": "A react-native wrapper for Zoom Meeting SDK",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
"!docs/"
|
|
26
26
|
],
|
|
27
27
|
"scripts": {
|
|
28
|
-
"test": "jest",
|
|
29
28
|
"typescript": "tsc --noEmit",
|
|
30
29
|
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
31
30
|
"prepare": "bob build",
|
|
@@ -71,6 +70,7 @@
|
|
|
71
70
|
"metro-react-native-babel-preset": "^0.77.0",
|
|
72
71
|
"pod-install": "0.1.38",
|
|
73
72
|
"prettier": "^2.7.1",
|
|
73
|
+
"react-native": "0.77.2",
|
|
74
74
|
"react-native-builder-bob": "0.18.3",
|
|
75
75
|
"react-test-renderer": "18.2.0",
|
|
76
76
|
"release-it": "^14.0.0",
|
|
@@ -80,13 +80,6 @@
|
|
|
80
80
|
"react": "*",
|
|
81
81
|
"react-native": "*"
|
|
82
82
|
},
|
|
83
|
-
"jest": {
|
|
84
|
-
"preset": "react-native",
|
|
85
|
-
"modulePathIgnorePatterns": [
|
|
86
|
-
"<rootDir>/example/node_modules",
|
|
87
|
-
"<rootDir>/lib/"
|
|
88
|
-
]
|
|
89
|
-
},
|
|
90
83
|
"commitlint": {
|
|
91
84
|
"extends": [
|
|
92
85
|
"@commitlint/config-conventional"
|
package/src/Context.ts
CHANGED
|
@@ -12,6 +12,7 @@ export interface ZoomSDKContext {
|
|
|
12
12
|
startMeeting: (config: StartMeetingConfig) => Promise<number>;
|
|
13
13
|
updateMeetingSetting: (config: MeetingSettingsConfig) => void;
|
|
14
14
|
isInitialized: () => Promise<boolean>;
|
|
15
|
+
cleanup: () => void;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
export const Context = createContext<ZoomSDKContext>({
|
|
@@ -19,4 +20,5 @@ export const Context = createContext<ZoomSDKContext>({
|
|
|
19
20
|
startMeeting: throwProviderError as any,
|
|
20
21
|
updateMeetingSetting: throwProviderError as any,
|
|
21
22
|
isInitialized: throwProviderError as any,
|
|
23
|
+
cleanup: throwProviderError as any,
|
|
22
24
|
});
|
|
@@ -43,10 +43,15 @@ export function useSDKHandler(config: InitConfig = {}): ZoomSDKContext {
|
|
|
43
43
|
return SDKHandler.current.startMeeting(config);
|
|
44
44
|
}, []);
|
|
45
45
|
|
|
46
|
+
const cleanup = useCallback(() => {
|
|
47
|
+
SDKHandler.current.cleanup();
|
|
48
|
+
}, []);
|
|
49
|
+
|
|
46
50
|
return {
|
|
47
51
|
isInitialized,
|
|
48
52
|
updateMeetingSetting,
|
|
49
53
|
joinMeeting,
|
|
50
54
|
startMeeting,
|
|
55
|
+
cleanup
|
|
51
56
|
};
|
|
52
57
|
}
|
package/src/native/ZoomSDK.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { NativeModules } from 'react-native';
|
|
2
2
|
import {
|
|
3
3
|
validateNonEmptyStringProp,
|
|
4
|
+
validateRequiredStringProp,
|
|
4
5
|
validateBooleanProp,
|
|
5
6
|
} from '../utils/validation';
|
|
6
7
|
|
|
@@ -18,9 +19,8 @@ export type InitConfig = {
|
|
|
18
19
|
|
|
19
20
|
export type MeetingSettingsConfig = {
|
|
20
21
|
disableVideoPreview?: boolean;
|
|
21
|
-
enableCustomizedMeetingUI?: boolean;
|
|
22
22
|
disableClearWebKitCache?: boolean;
|
|
23
|
-
language?: string;
|
|
23
|
+
language?: string; //Android only
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
export type JoinMeetingConfig = {
|
|
@@ -95,6 +95,7 @@ export type ZoomSDKType = {
|
|
|
95
95
|
startMeeting: (config: StartMeetingConfig) => Promise<number>;
|
|
96
96
|
updateMeetingSetting: (config: MeetingSettingsConfig) => void;
|
|
97
97
|
isInitialized: () => Promise<boolean>;
|
|
98
|
+
cleanup: () => void;
|
|
98
99
|
};
|
|
99
100
|
|
|
100
101
|
export class ZoomSDK implements ZoomSDKType {
|
|
@@ -105,17 +106,18 @@ export class ZoomSDK implements ZoomSDKType {
|
|
|
105
106
|
}
|
|
106
107
|
|
|
107
108
|
joinMeeting(config: JoinMeetingConfig) {
|
|
108
|
-
|
|
109
|
-
|
|
109
|
+
validateRequiredStringProp(config, 'JoinMeetingConfig', 'userName');
|
|
110
|
+
validateRequiredStringProp(config, 'JoinMeetingConfig', 'meetingNumber');
|
|
110
111
|
return RNZoomSDK.joinMeeting(config);
|
|
111
112
|
}
|
|
112
113
|
|
|
113
114
|
startMeeting(config: StartMeetingConfig) {
|
|
114
|
-
|
|
115
|
-
|
|
115
|
+
validateRequiredStringProp(config, 'StartMeetingConfig', 'userName');
|
|
116
|
+
validateRequiredStringProp(config, 'StartMeetingConfig', 'zoomAccessToken');
|
|
116
117
|
return RNZoomSDK.startMeeting(config);
|
|
117
118
|
}
|
|
118
119
|
|
|
119
120
|
updateMeetingSetting = RNZoomSDK.updateMeetingSetting;
|
|
120
121
|
isInitialized = RNZoomSDK.isInitialized;
|
|
122
|
+
cleanup = RNZoomSDK.cleanup;
|
|
121
123
|
}
|
package/src/utils/validation.ts
CHANGED
|
@@ -20,6 +20,30 @@ export const validateNonEmptyStringProp = (
|
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
+
export const validateRequiredStringProp = (
|
|
24
|
+
config: any,
|
|
25
|
+
errorLabel: string,
|
|
26
|
+
propName: string
|
|
27
|
+
) => {
|
|
28
|
+
const prop = config[propName];
|
|
29
|
+
|
|
30
|
+
assert.ok(
|
|
31
|
+
typeof prop !== 'undefined' && prop !== null,
|
|
32
|
+
`${errorLabel}: ${propName} is required`
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
assert.strictEqual(
|
|
36
|
+
typeof prop,
|
|
37
|
+
'string',
|
|
38
|
+
`${errorLabel}: ${propName} must be a string`
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
assert.ok(
|
|
42
|
+
prop.length > 0,
|
|
43
|
+
`${errorLabel}: ${propName} must have more then 0 characters`
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
|
|
23
47
|
export const validateBooleanProp = (
|
|
24
48
|
config: any,
|
|
25
49
|
errorLabel: string,
|