jitsi / jitsi-meet-sdk-samples

Jitsi Meet mobile SDK examples (Android, iOS and React Native)
Apache License 2.0
270 stars 235 forks source link

nothing happen when we click on end/cancel call #220

Open mubashiralisiddiqui opened 5 months ago

mubashiralisiddiqui commented 5 months ago

after we connect to the meeting url when we click on red button of end call nothing happen in react native android but in ios it works and get back to the join meeting page but on that page also close meeting option do nothing ios issue

jitsi ios

android issue

jitsiandroid2

here is my usage of code ` const Meeting = props => { const {route} = props; const jitsiMeetingRef = useRef(null); const navigation = useNavigation(); const backHandler = useRef(null);

useEffect(() => { if (Platform.OS === 'android') { backHandler.current = BackHandler.addEventListener( 'hardwareBackPress', () => { onClose(); return true; }, ); }

return () => {
  // Clean up the event listener
  if (Platform.OS === 'android') {
    backHandler.current.remove();
  }
};

}, []); const urlObject = new URL(route?.params?.jitsiUrl); const onClose = () => { console.log("close67890987y") navigation.goBack(); navigation.navigate('myBooking'); }; const onConferenceTerminated = nativeEvent => { console.log('Jitsi Terminated'); // JitsiMeet.endCall(); onClose(); }; // Get the value of the 'jwt' parameter from the URL search parameters const jitsiUrl = route?.params?.jitsiUrl; const jwt = jitsiUrl.split('?jwt=')[1]; const room = route?.params?.user || 'room'; return ( <JitsiMeeting // eventListeners={eventListeners} ref={jitsiMeetingRef} onConferenceTerminated={onConferenceTerminated} style={{flex: 1}} room={room} serverURL={route?.params?.jitsiUrl || 'https://meet.jit.si/'} token={jwt || ''} /> ); };

`

saghul commented 5 months ago

Make sure you add a listener for onReadyToClose: https://jitsi.github.io/handbook/docs/dev-guide/dev-guide-react-native-sdk#eventlisteners onConferenceTerminated is not a reliable way to decide to dispose the component.

mubashiralisiddiqui commented 5 months ago

@saghul Thanks event listner worked for me for android but for ios onReadyToclose not triggered so I need solution for ios now

saghul commented 5 months ago

In which case are you not getting it?

mubashiralisiddiqui commented 5 months ago

when I press on cancel call button the red button then onReadyToClose not triggered nothing happen same code working for android @saghul

mubashiralisiddiqui commented 5 months ago

when I click on cancel call it takes me out to join room page and nothing happen and the listnere didn't called

saghul commented 5 months ago

Which cancel, the Close one on the pre-join screen? Does the same happen on the sample app?

mubashiralisiddiqui commented 5 months ago

after I leave the meeting by cancel on red button press it takes me to pre-join screen and then nothing happen and yes I can reproduce same on example app

mubashiralisiddiqui commented 5 months ago

the issue is onReadyToclose is not triggering on ios

saghul commented 5 months ago

@Calinteodor PTAL and see if you can repro.

Calinteodor commented 5 months ago

https://github.com/jitsi/jitsi-meet-sdk-samples/assets/26413496/03b78646-d647-4266-a093-b774953f11e9

Using the sample app on iOS and onReadyToClose works as expected. Same for Android. Issue is not reproducible.

mubashiralisiddiqui commented 5 months ago

https://github.com/jitsi/jitsi-meet-sdk-samples/assets/16689214/9a50d369-5f4b-428a-89d6-3ba7a96d9c48

mubashiralisiddiqui commented 5 months ago

I am using the sample app project for my app I transfer all my code into sample app project and the code I used for Meeting component is exactly the same as in sample project

mubashiralisiddiqui commented 5 months ago

@saghul @Calinteodor I noticed now that its working fine on ios 17.0.1 simulator but not with ios 17.2 can you check if its related to specific ios version I checked on iphone14 simulator and it work well

saghul commented 5 months ago

Simulators can be unreliable.

Since they don't even emulate a camera I'd recommend you test in real hardware.