mieszko4 / react-native-zoom-us

MIT License
122 stars 116 forks source link

joinMeeting fails to launch Zoom video interface in existing iOS project #97

Closed TheMatrixMaster closed 2 years ago

TheMatrixMaster commented 2 years ago

Environment

"react-native-zoom-us": "^5.12.0"
"react-native": "^0.64.2"
"react": "^17.0.2"

"XCode": "12.5.1"
"Mac M1": "Big Sur 11.4" 
Running on a real device (iPhone XR)

Description

After following the docs and adding the package to my project, I was able to build the app on my iPhone and successfully use the initialize() method by providing my key and secret. However, when I call joinMeeting() with the appropriate parameters, the zoom interface never shows up. Bizarrely, I do receive the new video participant request on the host zoom client, but even after I admit the user, the zoom interface never shows up on my app. After encountering this behaviour, I cloned the example repository, and ran it with no such issues. I even modified the dependencies in the example project to exactly match the package.json in my react-native app, but I still couldn't reproduce the error. This leads me to believe that the issue probably originates from some weird xcode configuration that I set up previously, but I really can't pinpoint the mistake.

I can't supply the steps for a reproducible demo and the code is unfortunately proprietary so I can't share it here. I know I haven't provided much information to debug this, but I'm hoping package maintainers (@mieszko4) can point me towards the right spot to potentially run some logs around the zoom interfacing logic.

TheMatrixMaster commented 2 years ago

Finally managed to resolve this issue. I am on mac m1 and I had added the i386 architecture to the excluded architectures in my build settings. After removing this flag, I was able to build the app correctly and all join/start meeting features work fine.

rafi16jan commented 2 years ago

I'm using M1 too but I don't have any architecture excluded on the app or pods build settings.

rafi16jan commented 2 years ago

I'm using M1 too but I don't have any architecture excluded on the app or pods build settings.

Deleting and then reinstall the app on the emulator/device fixes the issue for me

mieszko4 commented 2 years ago

thnx @TheMatrixMaster for sharing the problem and solution! Can we then close this issue now?

drewklein20 commented 2 years ago

I'm also having this problem. I have no problem initializing but as soon as I press join, nothing happens. This is my joinMeeting code which I've verified has the correct meetingNumber and password. Strangely the logging or lack of logging seems to indicate something happening in the joinMeeting function.

 const joinMeeting = async (meetingDetails) => {
        console.log("This logs")
        const meetPass = JSON.parse(meetingDetails.settings).password
        try {
          console.log("This logs as well")
          const joinMeetingResult = await ZoomUs.joinMeeting({
              autoConnectAudio: true,
              userName: 'Wick',
              meetingNumber: meetingDetails.id || '',
              password: meetPass || '',
          });
          console.log("This does not log")
          console.log({joinMeetingResult});
        } catch (e) {
          console.log("This does not log either")
          Alert.alert('Error', 'Could not execute joinMeeting');
          console.error(e);
        }
        console.log("This does not log either")
      };

Also I've made sure no architectures are excluded in the build settings and have tried uninstalling the app several times.

TheMatrixMaster commented 2 years ago

@drewklein20, I've been playing around with this issue for a while and what I noticed is that the joinMeeting call works in the iOS release build, but when you load the app using the metro bundler, the behaviour is as you described. You can also try running the app on android which has worked on both debug/release builds for me.

drewklein20 commented 2 years ago

@drewklein20, I've been playing around with this issue for a while and what I noticed is that the joinMeeting call works in the iOS release build, but when you load the app using the metro bundler, the behaviour is as you described. You can also try running the app on android which has worked on both debug/release builds for me.

@TheMatrixMaster Interesting! Thanks for the advice! Does this mean I'll have to push a build up and then use testflight to download and actually test this? Or is there a simpler way that doesn't involve pushing up to appstore connect?

TheMatrixMaster commented 2 years ago

You can build a release version of your iOS app by modifying the build schemes. There should be by default a debug and a release scheme.

drewklein20 commented 2 years ago

I figured out my issue. I was using a JWT token for a server-to-server zoom app instead of an SDK app. I had to go into the zoom developer console and create a new "SDK" app and then use the client key and secret provided. What's strange is there was no logging indicating this was the issue. But happy it's working now!

mieszko4 commented 2 years ago

@drewklein20 :+1: Yeah I had the same problem before that's why I've created this test/sample app with steps how to get started: See https://github.com/mieszko4/react-native-zoom-us-test/blob/master/App.tsx#L19-L30 regarding SDK key - I made the process super simple to generate JWT based on sdkKey and sdkSecret