react-native-callkeep icon indicating copy to clipboard operation
react-native-callkeep copied to clipboard

When the app is in background event listener endCall does not fire requests until app is re-opened

Open brandudno opened this issue 3 years ago • 5 comments

Bug report

  • [ ] I've checked the example to reproduce the issue.

  • Reproduced on:

  • [ ] Android

  • [x] iOS

Description

When I have my app in the background and I receive VoIP notification and I reject/decline the call, I can see my event listener (endCall) is triggered by my logs, however I have a service API call within this method that should send a request to the server to notify that the call has been rejected.

`RNCallKeep.addEventListener('endCall', (callDetail: any) => { console.log('endCall is triggered'); RNCallKeep.backToForeground();

const stompService = new StompService(null); stompService.rejectIncomingCall(callDetail.callUUID); RNCallKeep.reportEndCallWithUUID(callDetail.callUUID, 2); });`

My stomp service request is not sent until I manually re-open the app, backToForeground seems to make no difference.

Versions

- Callkeep: 4.3.1
- React Native: 0.64.2
- iOS: 14.7.1
- Phone model: iPhone XS Max

brandudno avatar Jan 26 '22 09:01 brandudno

So, you're getting endCall is triggered printed in your logs, correct? It's whatever goes on inside stompService.rejectIncomingCall(callDetail.callUUID); that doesn't do anything?

If so, what are you doing inside that method? React Native stops firing RCT Timers immediately when Callkit doesn't have any calls running, so if you're doing any sort of timers, immediates or anything like that, those won't be executing.

The only work around is to either get Facebook to make react native execute timers in the background, or write something that hooks into IOS background execution framework and kick RCTTimers alive yourself.

jonastelzio avatar Feb 16 '22 14:02 jonastelzio

trying this before end call: RNCallKeep.reportEndCallWithUUID(callUUID, 2);

leahberkovits avatar Mar 03 '22 11:03 leahberkovits

Hi @brandudno , Do you have any solutions for this case? Currently I'm facing the same issue here

chopper2201 avatar Mar 18 '22 12:03 chopper2201

Hi, @brandudno. I'm having the same issue. Do you have any solutions for this case?

danilo-dsf avatar Jun 01 '22 14:06 danilo-dsf