react-native-webrtc / react-native-callkeep

iOS CallKit framework and Android ConnectionService for React Native
ISC License
901 stars 439 forks source link

App stuck after answering the call with incoming call screen. #546

Open dhavalpanchani opened 2 years ago

dhavalpanchani commented 2 years ago

Bug report

Description

Answering the call from the incoming UI display on android was not navigating me to the app, the UI acted as if I had never answered the call.

I have tried with these methods(endCall(), endAllCall()) for dismiss the call in "answerCall" listener but incoming UI still displayed.

Steps to Reproduce

https://user-images.githubusercontent.com/25957550/158823274-f33e85f1-e170-4465-aa4f-9f42912976da.mp4

Here is my coding:

messaging().setBackgroundMessageHandler(handleRemoteMessage);

export async function handleRemoteMessage(notification) { console.log( bg notification: ${JSON.stringify(notification)}, platform: ${ Platform.OS }, ${new Date().toDateString()}, );

const stringifiedData = notification?.data?.['pinpoint.jsonBody']; const parsedNotification = JSON.parse(stringifiedData || '{}'); const parsedData = JSON.parse(parsedNotification.data); RNCallKeep.displayIncomingCall( parsedData.meetingId, parsedData.callerName, parsedData.callerName, 'number', false, ); }

const onAnswerCall = async ({callUUID}) => { RNCallKeep.endCall(callUUID); // RNCallKeep.endAllCalls();

navigation.navigate('CallPage', { callFromNotification: true }); };

Versions

- Callkeep: "4.3.2"
- React Native: "0.63.4"
- Android: Android 10
- Phone model: MI A1

Logs

Paste here
trandinhhiep789 commented 2 years ago

Yes, I have tried these methods(endCall(), endAllCall()) to dismiss the call in "answerCall" listener but incoming UI is still displayed too. Have you solved this problem yet?

juanxog commented 2 years ago

@trandinhhiep789 same here! did you find any solution ?

iim-norse commented 2 years ago

same here :( any solution ?

convertcompany commented 2 years ago

Hey guys,

I've been having the same issue, but managed to get it working with the "setCurrentCallActive"

You could add it on the answer event listener.


const answerCall = () => {
        RNCallKeep.setCurrentCallActive("YOUR CALL UUID");
}
avencat commented 1 year ago

Hi there! A year later, we're still having this issue, after some digging on my side, it appears that the 'endCall' listener is being triggered immediately after displayIncomingCall has been called. I've added logs here (#626) but didn't find any solution yet (@convertcompany solution did not work for me as the issue happens before the "answer call" button is tapped)

Irfanwani commented 3 weeks ago

In my case, answerCall eventlistener is not added sometimes, and this mainly happens in production mode on android.

Irfanwani commented 3 weeks ago

Isthere any way to check whether the eventlistener is added or not. I want to do something like, if eventlistener fails to add, i will try again until it suceeds, but as eventlisteners don't throw any error, i don't know any way to do so.