ConnectyCube / connectycube-reactnative-samples

Chat and Video Chat code samples for React Native, ConnectyCube
https://connectycube.com
Apache License 2.0
125 stars 111 forks source link

Call Listener #146

Closed krishna11124 closed 3 years ago

krishna11124 commented 3 years ago

How To Remove on Call Listener While Component Will Unmount..

ccvlad commented 3 years ago

ConnectyCube.videochat.onCallListener = null will rewrite prev listener, so you won't receive a call. Under the hood of ConnectyCube SDK the XMPP chat delegates stanzas and calls ConnectyCube.videochat.onCallListener if it has typeof === 'function' on an incoming call's signaling.

krishna11124 commented 3 years ago

Okey, Can't Remove A Call Listener??

DaveLomber commented 3 years ago

Setting null means removing it, so it should work just well

krishna11124 commented 3 years ago

Hi, actually i have a scenario of calling i create a single incoming calling screen and set the only call listener on the home page for redirection of the incoming call screen its redirect successfully from receive request from the call listener on the home page but in the incoming call screen the call process or call listener is not working..thanks can u please help me

ccvlad commented 3 years ago

@krishna11124

You can use onCallListener to redirect with data from the listener on other screen where you will connect other listeners such as onRemoteStreamListener, onStopCallListener etc. (check our docs). Or use High Order Component to connect all listeners and provide all data to children (or via Redux state)