ConnectyCube / connectycube-reactnative-samples

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

error: Failed to set remote answer sdp: Called in wrong state: stable #285

Closed UmerQur3shi closed 2 years ago

UmerQur3shi commented 2 years ago

Hey there, It's working fine if the App is opened from killed state. But the issue is caused when the App is opened from background state and then I try to make a call, onCall is triggered on both the caller and callees side and if the person I'm calling accepts the call I get this error >> ERROR [VideoChat]: 'setRemoteSessionDescription' error: Failed to set remote answer sdp: Called in wrong state: stable. The error popups only when I try to make a call, there is no issue in receiving calls. I think it is caused because of recreating ConnectyCube session for login when I come back from background but I have no choice, I'm using my firebase as CIDP for logging in and If I do not recreate session and skip login when coming back from background then for every query it says token is required. Please help, thanks.

UmerQur3shi commented 2 years ago

@DaveLomber I'm stuck and waiting for your response :(

DaveLomber commented 2 years ago

@UmerQur3shi make sure when you call - you only pass an array of others users ids. Do not need to include your own user id in it.

In fact - you as a caller - should never receive the 'onCall' callback, only others users should get it

UmerQur3shi commented 2 years ago

@DaveLomber that was happening because I initialized ConnectyCube in App.js, Initializing it in index.js solved the issue for me :)

DaveLomber commented 2 years ago

@UmerQur3shi ok nice to see it's solved ;)