skrafft / react-native-jitsi-meet

React native wrapper for Jitsi Meet SDK
Apache License 2.0
285 stars 348 forks source link

Hlo i am using jitsi meet version 2.1.1 and when i try to connect my meeting url with jwt it is stuck in connecting to meeting.The issue is only in ios but works fine in android #438

Open Shekhardeuba opened 1 year ago

Shekhardeuba commented 1 year ago

import React, { useEffect, useState } from 'react'; import { Platform, View } from 'react-native'; import JitsiMeet, { JitsiMeetView } from 'react-native-jitsi-meet';

import { Colors } from '../../../Constants';

function Jitsi({ jitsiData, tabIndex }) { useEffect(() => { setTimeout(() => { console.log('jitsiData =>', jitsiData);

  const options = {
    audioMuted: false,
    audioOnly: false,
    videoMuted: false,
    subject: '',
    token: jitsiData.jwt,
  };
  const meetFeatureFlags = {
    addPeopleEnabled: false,
    calendarEnabled: false,
    callIntegrationEnabled: false,
    chatEnabled: false,
    closeCaptionsEnabled: false,
    inviteEnabled: false,
    androidScreenSharingEnabled: false,
    liveStreamingEnabled: false,
    meetingNameEnabled: false,
    meetingPasswordEnabled: false,
    pipEnabled: false,
    kickOutEnabled: false,
    conferenceTimerEnabled: false,
    videoShareButtonEnabled: false,
    recordingEnabled: false,
    reactionsEnabled: false,
    raiseHandEnabled: false,
    tileViewEnabled: true,
    toolboxAlwaysVisible: false,
    toolboxEnabled: true,
    welcomePageEnabled: false,
  };

  const url = jitsiData.meetingUrl + '?jwt=' + jitsiData.jwt;
  console.log(url);

  JitsiMeet.call(
    // jitsiData.meetingUrl ,
    url,
    jitsiData.userInfo,
    options,
    meetFeatureFlags,
  );
}, 1000);

return () => {
  JitsiMeet.endCall();
};

}, []);

const [showJitsi, setShowJitsi] = useState(true);

function onConferenceTerminated(nativeEvent) { / Conference terminated event / console.warn('Terminated', nativeEvent); }

function onConferenceJoined(nativeEvent) { / Conference joined event / console.warn('Joined', nativeEvent); if (Platform.OS == 'android') { setShowJitsi(false); setTimeout(() => { setShowJitsi(true); }, 100); } }

function onConferenceWillJoin(nativeEvent) { / Conference will join event / console.warn('Will Join', nativeEvent); }

return ( <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: Colors.black_000000, }}> {showJitsi && ( <JitsiMeetView onConferenceTerminated={onConferenceTerminated} onConferenceJoined={onConferenceJoined} onConferenceWillJoin={onConferenceWillJoin} style={{ // flex: 1, height: '100%', width: tabIndex === 0 ? '100%' : '100%', backgroundColor: Colors.transparent, }} /> )} ); }

export default Jitsi;