mieszko4 / react-native-zoom-us-test

Example repository of using react-native-zoom-us bridge
16 stars 13 forks source link

Getting this error [Error: Error= 5 (unknown), internalErrorCode=124] #74

Closed anehkumar closed 9 months ago

anehkumar commented 9 months ago

Hi, I am getting this error [Error: Error= 5 (unknown), internalErrorCode=124]

const getSdkJwtToken = async (
  sdkKey,
  sdkSecret,
  expiresInSeconds,
) => {
  const epochInSeconds = Math.round(new Date().getTime() / 1000);

  const payload = {
    appKey: sdkKey,
    iat: epochInSeconds,
    exp: epochInSeconds + expiresInSeconds,
    tokenExp: epochInSeconds + expiresInSeconds,
  };

  const token = await sign(payload, sdkSecret, {
    algorithm: 'HS256',
    typ: 'JWT',
  });

  return token;
};
const initializeZoom = async (sdkKey, sdkSecret) => {
    try {
      /* await ZoomUs.initialize({
        clientKey: sdkKey,
        clientSecret: sdkSecret,
      }, {
        language: 'en-US',
        enableCustomizedMeetingUI,
      }); */

      let jwtToken = await getSdkJwtToken(sdkKey, sdkSecret, 3600);
      console.log("jwtToken", jwtToken);

      const initializeResult = await ZoomUs.initialize({
        jwtToken: jwtToken,
        domain: 'zoom.us',
      }, {
        language: 'en-US',
        disableShowVideoPreviewWhenJoinMeeting: true,
        enableCustomizedMeetingUI: true,
      });

      setIsInitialized(true);
    } catch (e) {
      Alert.alert('Error', e.message);
      console.log(e);
    }
  }

Can you please help me to fix this. I am using "react-native-zoom-us": "^6.20.0",

mieszko4 commented 2 months ago

@anehkumar In the future, it would be great if you could post your solution so that others can learn from it if they encounter the issue.