nagarro-dv / react-native-zoom-us-bridge

React Native bridge for Zoom SDK for iOS + Android
MIT License
45 stars 23 forks source link

(some) Listeners don't work #13

Open pantgurra opened 4 years ago

pantgurra commented 4 years ago

Please provide as much details as possible... The more info provided the better

Description

I don't get the meetingEnded (nor meetingStarted) to work on IOS. SDKInitialized and meetingJoined works fine.

React Native version:

System: OS: macOS 10.15.4 CPU: (8) x64 Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz Memory: 910.90 MB / 16.00 GB Shell: 5.7.1 - /bin/zsh Binaries: Node: 14.3.0 - ~/.nvm/versions/node/v14.3.0/bin/node Yarn: 1.22.4 - /usr/local/bin/yarn npm: 6.14.5 - ~/.nvm/versions/node/v14.3.0/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman Managers: CocoaPods: 1.9.1 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2 Android SDK: API Levels: 28, 29 Build Tools: 28.0.3, 29.0.0, 29.0.2, 29.0.3 System Images: android-28 | Intel x86 Atom_64, android-28 | Google Play Intel x86 Atom, android-29 | Google APIs Intel x86 Atom Android NDK: Not Found IDEs: Android Studio: 4.0 AI-193.6911.18.40.6514223 Xcode: 11.5/11E608c - /usr/bin/xcodebuild Languages: Java: 1.8.0_252 - /usr/bin/javac Python: 2.7.16 - /usr/bin/python npmPackages: @react-native-community/cli: Not Found react: 16.11.0 => 16.11.0 react-native: 0.62.2 => 0.62.2 npmGlobalPackages: react-native: Not Found

Steps To Reproduce

  1. Create listener for meetingEnded that logs the result
  2. Create, start and end a meeting

Expected Results

That the result appears in my log

Nitinbhoyar commented 4 years ago

I was also facing similar issues in Android bt startmeeting and joinMeeting returns promise. You can track results returned in promise.

jatinggrwl commented 4 years ago

Solution for android

open this file node_modules/@mokriya/react-native-zoom-us-bridge/android/src/main/java/com/mokriya/zoomus/RNZoomUsBridgeModule.java

comment the line no 234 //meetingPromise = null

RNZoomUsBridgeModule.java

 @Override
    public void onMeetingStatusChanged(MeetingStatus meetingStatus, int errorCode, int internalErrorCode) {
        Log.i(TAG, "onMeetingStatusChanged, meetingStatus=" + meetingStatus + ", errorCode=" + errorCode + ", internalErrorCode=" + internalErrorCode);
        if (meetingPromise == null) {
        return;
        }

        WritableMap params = Arguments.createMap();

        if(meetingStatus == MeetingStatus.MEETING_STATUS_FAILED) {
        meetingPromise.reject(
                "ERR_ZOOM_MEETING",
                "Error: " + errorCode + ", internalErrorCode=" + internalErrorCode
        );
        meetingPromise = null;
        } else if (meetingStatus == MeetingStatus.MEETING_STATUS_DISCONNECTING) {

        sendEvent(reactContext, "meetingEnded", params);
           meetingPromise = null;
        } else if (meetingStatus == MeetingStatus.MEETING_STATUS_INMEETING) {

        sendEvent(reactContext, "meetingStarted", params);
        meetingPromise.resolve("Connected to zoom meeting");
        // meetingPromise = null;     <- this line 

        } else {
        params.putString("eventProperty", "onMeetingStatusChanged, meetingStatus=" + meetingStatus + ", errorCode=" + errorCode + ", internalErrorCode=" + internalErrorCode);
        sendEvent(reactContext, "meetingStatusChanged", params);
        }
    }

save the file

then clean your android build i.e cd android ./gradlew clean cd.. close metro bundler close remote debugger (if open)

react-native run-android

now when you leave the meeting "meetingEnded" listner will trigger

arunnambissan commented 3 years ago

Still some times listeners are not working - meetingStarted & meetingEnded listeners

youngdecade26 commented 2 years ago

Still same issue - meetingEnded listeners is not working in android