I am using this module for video calling and in my screen the video is connect and have a back button in that.
So, I want when click on back button I showed an alert like are you sure you want to leave so when user clicks leave then I want to leave the room and disconnect from socket
I kept the following code
Alert.alert( 'Fanler', 'Are you sure you want to leave the page?', [ {text: 'No', onPress: () => console.log('Cancel Pressed'), style: 'cancel'}, {text: 'Yes', onPress: () => { alert('socketId'+this.state.socketId); socket.on('leave', function(socketId){ leave(this.state.socketId); }); }}, ], { cancelable: false } )
Expected behavior
the user has to leave the room and disconnect from socket
Observerd behavior
so when click on that no action is getting performed and leave method is not at all calling.
So can u tell me how to leave the room and disconnect when clicking on back button?
I'm facing a similar issue. Need to understand how we can call socket.diconnect() or do we need to emit a disconnect event. I've tried both but it doesn't seem to be working?
Hi,
I am using this module for video calling and in my screen the video is connect and have a back button in that.
So, I want when click on back button I showed an alert like are you sure you want to leave so when user clicks leave then I want to leave the room and disconnect from socket I kept the following code Alert.alert( 'Fanler', 'Are you sure you want to leave the page?', [ {text: 'No', onPress: () => console.log('Cancel Pressed'), style: 'cancel'}, {text: 'Yes', onPress: () => { alert('socketId'+this.state.socketId); socket.on('leave', function(socketId){ leave(this.state.socketId); }); }}, ], { cancelable: false } )
Expected behavior the user has to leave the room and disconnect from socket
Observerd behavior so when click on that no action is getting performed and leave method is not at all calling. So can u tell me how to leave the room and disconnect when clicking on back button?
Platform information in both iOS and android
React Native version: ^0.43.3 Plugin version:^1.63.0