Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android12 plus fixes #51

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# react-native-zoom-us-bridge
This library bridges React Native with zoom.us SDK and implements the SDK authentication process.

Library updated to use iOS SDK 5.5.12511.0421 and Android SDK version 5.5.1.1319, or higher
Library updated to use iOS SDK v5.12.2.4959 and Android SDK version v5.12.2.9109, or higher

***Note: User login using zoom user accounts is not implemented.***

Expand Down
59 changes: 36 additions & 23 deletions android/src/main/java/com/mokriya/zoomus/RNZoomUsBridgeModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.bridge.Arguments;

import us.zoom.sdk.MeetingParameter;
import us.zoom.sdk.ZoomSDK;
import us.zoom.sdk.ZoomError;
import us.zoom.sdk.ZoomSDKInitParams;
import us.zoom.sdk.ZoomSDKInitializeListener;

import us.zoom.sdk.MeetingStatus;
Expand Down Expand Up @@ -74,8 +76,10 @@ public void initialize(final String appKey, final String appSecret, final Promis
@Override
public void run() {
ZoomSDK zoomSDK = ZoomSDK.getInstance();

zoomSDK.initialize(reactContext.getCurrentActivity(), appKey, appSecret, RNZoomUsBridgeModule.this);
ZoomSDKInitParams params = new ZoomSDKInitParams();
params.appKey = appKey;
params.appSecret = appSecret;
zoomSDK.initialize(reactContext.getCurrentActivity(), RNZoomUsBridgeModule.this, params);
}
});
} catch (Exception ex) {
Expand Down Expand Up @@ -163,27 +167,31 @@ public void joinMeeting(
) {
try {
meetingPromise = promise;

ZoomSDK zoomSDK = ZoomSDK.getInstance();
if(!zoomSDK.isInitialized()) {
promise.reject("ERR_ZOOM_JOIN", "ZoomSDK has not been initialized successfully");
return;
}

final MeetingService meetingService = zoomSDK.getMeetingService();

JoinMeetingOptions opts = new JoinMeetingOptions();
JoinMeetingParams params = new JoinMeetingParams();
params.displayName = displayName;
params.meetingNo = meetingNo;
params.password = meetingPassword;

int joinMeetingResult = meetingService.joinMeetingWithParams(reactContext.getCurrentActivity(), params, opts);
Log.i(TAG, "joinMeeting, joinMeetingResult=" + joinMeetingResult);

if (joinMeetingResult != MeetingError.MEETING_ERROR_SUCCESS) {
promise.reject("ERR_ZOOM_JOIN", "joinMeeting, errorCode=" + joinMeetingResult);
}
reactContext.getCurrentActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
ZoomSDK zoomSDK = ZoomSDK.getInstance();
if (!zoomSDK.isInitialized()) {
promise.reject("ERR_ZOOM_JOIN", "ZoomSDK has not been initialized successfully");
return;
}

final MeetingService meetingService = zoomSDK.getMeetingService();

JoinMeetingOptions opts = new JoinMeetingOptions();
JoinMeetingParams params = new JoinMeetingParams();
params.displayName = displayName;
params.meetingNo = meetingNo;
params.password = meetingPassword;

int joinMeetingResult = meetingService.joinMeetingWithParams(reactContext.getCurrentActivity(), params, opts);
Log.i(TAG, "joinMeeting, joinMeetingResult=" + joinMeetingResult);

if (joinMeetingResult != MeetingError.MEETING_ERROR_SUCCESS) {
promise.reject("ERR_ZOOM_JOIN", "joinMeeting, errorCode=" + joinMeetingResult);
}
}
});
} catch (Exception ex) {
promise.reject("ERR_UNEXPECTED_EXCEPTION", ex);
}
Expand Down Expand Up @@ -237,6 +245,11 @@ public void onMeetingStatusChanged(MeetingStatus meetingStatus, int errorCode, i
}
}

@Override
public void onMeetingParameterNotification(MeetingParameter meetingParameter) {

}

private void registerListener() {
Log.i(TAG, "registerListener");
ZoomSDK zoomSDK = ZoomSDK.getInstance();
Expand Down