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

How to leave or disconnect the room? #66

Open
bacancy-swaroopa opened this issue Jun 27, 2018 · 2 comments
Open

How to leave or disconnect the room? #66

bacancy-swaroopa opened this issue Jun 27, 2018 · 2 comments

Comments

@bacancy-swaroopa
Copy link

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

@shreyas-algo
Copy link

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?

@YuePing1104
Copy link

这个demo你们都可以运行起来吗?为什么我一直报错

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