Then I'm using useFocusEffect in my view to manage the disconnect logic (I want someone to disconnect when they leave the current screen).
useFocusEffect(useCallback(()=>{
//Connect with the screen is focused
const connectParams = {
childrenNames: params.childrenNames as string,
talkAbout: params.talkAbout as string
}
connect(connectParams);
//Disconnect on blur
return ()=>{
disconnect();
}
}, []))
In my log, I can see the "disconnected" message in react-native. But on my membrane server, I still see the log messages indicating the client is connected. The microphone isn't toggled off properly, and since I'm using a simple echo endpoint for testing right now, I still hear my voice echo'd back.
I'm having trouble with the disconnect function. It doesn't appear to be successfully disconnecting from my membrane webrtc server.
This is my disconnect function which I attach to the provider.
Then I'm using useFocusEffect in my view to manage the disconnect logic (I want someone to disconnect when they leave the current screen).
In my log, I can see the "disconnected" message in react-native. But on my membrane server, I still see the log messages indicating the client is connected. The microphone isn't toggled off properly, and since I'm using a simple echo endpoint for testing right now, I still hear my voice echo'd back.