Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React native jitsi meet sdk hang up #244

Open
wbmcircle opened this issue Aug 8, 2024 · 10 comments
Open

React native jitsi meet sdk hang up #244

wbmcircle opened this issue Aug 8, 2024 · 10 comments

Comments

@wbmcircle
Copy link

wbmcircle commented Aug 8, 2024

Screenshot_20240808_080834
Screenshot_20240808_075748
Hello team
how are you? Could you please help me to solve react native sdk problem?
I'm using import { JitsiMeeting } from '@jitsi/react-native-sdk';.
If any side who click hangup on jitsi meeting page of app before both of them enter meeting room, app will crash. then I should re-install the app.
I attached my screens.
`

export default function CustomMeeting() {
  const { t } = useTranslation();
  const { chatId, workspaceId } = useParams();
  const { roomName, isVideoDisabled, enableMic, setOpenCalling } = useMeeting();
  const { userdata, user } = useUser();
  const navigation = useNavigation();
  const jitsiMeeting = useRef(null);
  const [endCall, setEndCall] = useState(false);
  const route = useRoute();

  const endConference = async () => {
    try {
      const { directId } = await postData('/directs', {
        workspaceId,
        userId: user?.uid,
      });
      setOpenCalling(false);
      navigation.navigate('Home')
      // if (chatId) {
      //   navigation.navigate('Chat', {
      //     objectId: directId
      //   });
      // } else {
      // }
    } catch (err) {
      console.error(err)
    }
  }
  const handleHangup = useCallback(async () => {
    try {
      if (!endCall) {
        setEndCall(true);
        await endConference();
      }
    } catch (err) {
      console.error(err);
    }
  }, [endCall, endConference]);


  useEffect(() => {
    const unsubscribe = navigation.addListener('beforeRemove', handleHangup);
    return unsubscribe;
  }, [navigation, handleHangup]);


  const onReadyToClose = useCallback(async () => {
    try {
      setOpenCalling(false);
      navigation.navigate('Home')
    } catch (err) {
      console.error('close', err)
    }
  }, [navigation]);

  const onParticipantLeft = useCallback(async () => {
    try {
      if (!endCall) {
        setEndCall(true);
        await endConference();
      }
    } catch (err) {
      console.error(err)
    }
  }, [navigation]);

  const eventListeners = {
    onReadyToClose,
    onParticipantLeft
  };

  return (
    <JitsiMeeting
      style={{ flex: 1 }}
      room={route.params?.roomName}
      serverURL={env.MEETING_URL}
      userInfo={{
        avatarURL: '',
        displayName: '',
        email: ''
      }}
      config={{
        prejoinPageEnabled: false,
        startAudioOnly: route.params?.audioOnly,
        subject: t("Video Call"),
      }}
      ref={jitsiMeeting}
      eventListeners={eventListeners}
    />

  );
};

`

Looking forward to hearing from you.
Thank you

@saghul
Copy link
Member

saghul commented Aug 8, 2024

Please provide logs that show the crash.

@wbmcircle
Copy link
Author

What kind of log I should show you?

@wbmcircle
Copy link
Author

Let me show you some logs that may help you.
image
image
image
image
image

@wbmcircle
Copy link
Author

image
image
image

@wbmcircle
Copy link
Author

@saghul Please let me know if these logs can help to solve my problem. Thank you

@saghul
Copy link
Member

saghul commented Aug 8, 2024

They don't, sorry. The only error there seems related to GMS and happens in another process, not the app.

What RN SDK version are you using? Do you get a red screen?

@wbmcircle
Copy link
Author

"@jitsi/react-native-sdk": "^2.2.1",
"react-native": "0.68.2",

I don't see red screen

@wbmcircle
Copy link
Author

Thank you for your answer.
When I click hangup button before enter another side, app still loading(mentioned mobile image).

@wbmcircle
Copy link
Author

When integrating Jitsi SDK in a React Native app, if the app crashes when you click hangup after inviting someone to a call and before they join the meeting, there could be several reasons:

Inconsistent State: When you invite someone to a meeting, the Jitsi SDK enters a state of waiting for the other person to join. If you hang up before they join, it might lead to an inconsistent state, causing a crash.

Event Listeners Not Cleaned Up: If you click the hangup button, and the event listeners related to the meeting are not properly cleaned up or removed, it might lead to memory leaks or crashes.

Internal SDK Error: There might be unhandled errors or bugs within the Jitsi SDK that do not handle the hangup operation correctly in this specific situation.

Concurrency Issues: Handling multiple operations simultaneously (like inviting a user and hanging up) without proper synchronization mechanisms might cause concurrency issues, leading to crashes.

I saw this, but didn't find solution.

@Calinteodor
Copy link
Contributor

Calinteodor commented Aug 8, 2024

"@jitsi/react-native-sdk": "^2.2.1",
"react-native": "0.68.2",

I don't see red screen

You are way behind with @jitsi/react-native-sdk. Please try updating to latest, which is 10.0.0.
Also, please consider following this guide so you don't miss important updates.
https://jitsi.github.io/handbook/docs/dev-guide/dev-guide-react-native-sdk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants