
Description
I have a voip video calling app.
I am using Callkeep exclusively for IOS, to access IOS callkit.
I have a component that listens to both onRNCallKeepPerformAnswerCallAction and onRNCallKeepPerformEndCallAction. In both cases it will send a message back to the server to update the database about the status of the call - answered or rejected, respectively.
With app in foreground there is no problem, everything works fine.
When the app is in kill state or background, however, and a call comes in, it rings using the callkit ui, as expected.
When I answer, everything works fine.
But when I reject the call the 'onRNCallKeepPerformEndCallAction' listener in react native is not triggered. Instead the app is killed. Therefore, my function signaling to the server that the receiver has rejected the call never goes out.
Only after I manually restart the app, or bring it to the foreground, do I see the api call conveying the message. This is too late. It needs to happen immediately so that the caller knows the call has been rejected.
How can I communicate between callkit UI and react-native for rejected calls when the app is in the background?
Versions
- Callkeep: 3.0.10
- React Native: 0.61.5
- iOS: 12.4.5
- Phone model: IPhone6