Open jatins52 opened 3 years ago
Nope. I used this exactly to end a call on callee to to notify caller about call rejection.
@Romick2005 Thank you for answering. You did this action when user answers the call if I am getting it right. My concern is when the caller cancels the call I need to perform endCall at receiver end. For this I created a firestore listener when incoming call is displayed, when call canceled is set true (it will be written in firestore document when caller cancels the call) I need to perform endCall at receiver end also. This works for first time but the firebase listener is not destroyed and when the call is made again from any user it reads cancelled true and performs endCall for all further incoming calls.
Nope. I used this exactly to end a call on callee to to notify caller about call rejection.
Ohk If receiver rejects the call I can notify caller using real-time Firestone document value change. This works when caller calls and cancels but I am unable to destroy listener. callDataSubscription
thank you
This is not a bug but I did not know where to post my question?
I have used agora.io for call and firebase for voip push notifications. react-native-callkeep : for showing incoming call when voip push notification is arrived. Web RTC : agora.io Firebase Firestore: for realtime database
my calls are successful when user accepts incoming call on IOS and android. But when a user calls other user and it shown incoming call on IOS or Android and then caller cancels the call, how do I disconnect ?
Approach I tried is to create Firebase collection listener inside "RNCallKeep.addEventListener('didDisplayIncomingCall', (data) => {}" (I am using firebase database), but the issue is that it works for first time then for next calls the old listener works and does not get destroyed.
Any ideas are welcome.
My code sample for firestore document subscription when incoming call is displayed:
// RNCallKeep.addEventListener('didDisplayIncomingCall', (data) => { // console.log('didDisplayIncomingCall', data); // #TODO: search for ways to handle this case for missed calls // callDataSubscription = currentCallRef.onSnapshot({ // error: (error => { // console.log(error); // }), // next: (snap) => { // const callData = snap.data(); // console.log('callData', callData) // if (callData.cancelled === true || callData.missed === true || callData.disconnected === true) { // RNCallKeep.endCall(data.callUUID); // return; // } // } // }); // setTimeout(() => { // if (typeof callDataSubscription === 'function') { // callDataSubscription() // callDataSubscription = null; // } // // currentCallRef = null; // }, 5000); // });
Commented code is where I am ending call depending on what data is gets. When caller cancels the call before callee accepts it the document will save "missed" and "disconnected" true.
Thank you in advance