React Native:Zoom Android SDK:"startMeetingWithParams"以参与者身份开始会议 - 需要它以主持人身份开始会议



"startMeetingWithParams";以参与者身份开始会议-需要它以主持人身份开始会议:我正试图用react native zoom us开源项目创建一个简单的应用程序,据称该项目是通往";缩放android sdk";。zoom android sdk正通过导入";uszoom.sdk.ZoomSDK";。它提供的基本功能包括android sdk的MeetingService的startMeetingWithParams((函数。在下面附的代码中,我可以看到他们用某些参数设置StartMeetingParamsWithoutLogin((,然后将其作为参数传递给startMeetingWithParams((。这是以用户作为参与者开始会议(即使在参数"userId"中设置了会议的host_id(,并且默认的等候室屏幕显示为等待主持人开始会议,而期望以主持人的身份开始会议。请给出你对此的推论,并让我知道需要做些什么来解决这个问题。StartMeetingOptions需要做些什么吗?这里的userType参数是什么?对于专业用户来说,它被称为"integer:2"。但是,我不确定我是什么类型的缩放用户。请告诉我如何了解userType。

@ReactMethod
public void startMeeting(
final String displayName,
final String meetingNo,
final String userId,
final int userType,
final String zoomAccessToken,
final String zoomToken,
Promise promise
) {
try {
meetingPromise = promise;
ZoomSDK zoomSDK = ZoomSDK.getInstance();
if(!zoomSDK.isInitialized()) {
promise.reject("ERR_ZOOM_START", "ZoomSDK has not been initialized successfully");
return;
}
final MeetingService meetingService = zoomSDK.getMeetingService();
if(meetingService.getMeetingStatus() != MeetingStatus.MEETING_STATUS_IDLE) {
long lMeetingNo = 0;
try {
lMeetingNo = Long.parseLong(meetingNo);
} catch (NumberFormatException e) {
promise.reject("ERR_ZOOM_START", "Invalid meeting number: " + meetingNo);
return;
}
if(meetingService.getCurrentRtcMeetingNumber() == lMeetingNo) {
meetingService.returnToMeeting(reactContext.getCurrentActivity());
promise.resolve("Already joined zoom meeting");
return;
}
}
StartMeetingOptions opts = new StartMeetingOptions();
StartMeetingParamsWithoutLogin params = new StartMeetingParamsWithoutLogin();
params.displayName = displayName;
params.meetingNo = meetingNo;
params.userId = userId;
params.userType = userType;
params.zoomAccessToken = zoomAccessToken;
// params.zoomToken = zoomToken;
int startMeetingResult = meetingService.startMeetingWithParams(reactContext.getCurrentActivity(), params, opts);
Log.i(TAG, "startMeeting, startMeetingResult=" + startMeetingResult);
if (startMeetingResult != MeetingError.MEETING_ERROR_SUCCESS) {
promise.reject("ERR_ZOOM_START", "startMeeting, errorCode=" + startMeetingResult);
}
} catch (Exception ex) {
promise.reject("ERR_UNEXPECTED_EXCEPTION", ex);
}
}

要使用api,您需要将订阅升级为付费用户。检查您是否能够主持超过40分钟的会议。

根据ZOOM Android SDK参考https://marketplace.zoom.us/docs/sdk/sdk-reference/android-reference:

在看了SDK源代码之后,这些是userTypes:的值

int USER_TYPE_API_USER = 0;
int USER_TYPE_ZOOM = 1;
int USER_TYPE_FACEBOOK = 2;
int USER_TYPE_GOOGLE_OAUTH = 3;
int USER_TYPE_SSO = 4;
int USER_TYPE_UNKNOWN = -1;

正如您所看到的,它引用了用户登录的方式和方式。我决定使用USER_TYPE_API_USER,因为我需要下载Zoom访问令牌(通过使用Zoom API(。

我还在这里创建了关于将Zoom SDK移植到React Native的教程:https://stefanmajiros.medium.com/how-to-integrate-zoom-sdk-into-react-native-47492d4e46a6

相关内容

  • 没有找到相关文章

最新更新