Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to handle the cancel VOIP push comes after rejecting the incoming call push

I have already developed a VOIP call app that uses pushkit for VOIP push notification. Our notification server is designed to deliver all cancel notifications along with new incoming call notifications through VOIP push (This behavior can't be changed as of now). Since it has become mandatory to report all incoming push notifications to callkit after the iOS 13 release. There are scenarios where I am not able to report the cancel PUSH notification to callkit which ultimately result in app crash

Scenario:

If the user rejects the incoming call PUSH notification (i.e. basically rejecting the incoming call), the notification server delivers a cancel PUSH notification just after that. But since the new incoming call has already been rejected and there is no active callId to report, there is no way to report the cancel PUSH notification to callkit. So, failure to report the cancel push results in in-app crash. This does happen in all those where there is no active/pending call and the client the PUSH for cancel notification.

Please help me out with how to handle this scenario.

like image 785
Harish Gupta Avatar asked Dec 02 '25 08:12

Harish Gupta


1 Answers

As you've said: starting from iOS 13 it has become mandatory to report a new incoming call for every VoIP push received.

There's no way around that. If you can't change the behavior of your server, the only thing you can do to avoid a crash (and the blocking of subsequent VoIP pushes delivery) is to report a fake call to make PushKit happy and immediately terminate it.

let callId = UUID()
cxProvider.reportNewIncomingCall(
    with: callId,
    update: callUpdate,
    completion: { [weak self] error in
        completion()
        self?.cxProvider.reportCall(with: callId, endedAt: nil, reason: .failed)
})
like image 138
Marco Avatar answered Dec 03 '25 23:12

Marco



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!