Issues with IOS 13 VOIP Push Notifications - App Crashing when killed

Hello,
We are implementing IOS 13 VOIP Push Notifications with Cordova. Here is the native code of the plugin that we are using for that:
https://github.com/Qvadis/cordova-plugin-callkit/blob/a772ff883f79beea783b0f2566d09338dc5fd589/src/ios/CordovaCall.m
When app is open or in background, all is OK, VOIP pushes are coming in and Native Dialer from Callkit is shown.
The problem is when app is killed - When a VOIP Push is sent, app seems to be crashing - Here is a log for that
https://gist.github.com/AleksandarTokarev/74068feadd728a4bd1c672a024482af4
I was looking at the forums about this error code and here is what i found:

https://developer.apple.com/forums/thread/124517
The exception code "0xbaadca11" indicates that your app was killled for failing to report a CallKit call in response to a PushKit notificaiton. That should have been clear in the crash log, but this particular requirement is implemented through multiple code paths and it looks like this one isn't as clear as the others. For more details on the new requirement, take a look at:
Strange that this happens only when app is killed, otherwise it works ok


Can someone give me an explanation and some help why this is happening when app is killed and not when app is open or in background?

NOTES: We are using Amazon SNS to send VOIP pushes with the following payload
Code Block
let voip_protocol_value = `{"aps" : { "alert": "New Incoming Call" }, "data" : { "Caller": { "Username" : "${caller}", "ConnectionId": "${Random.id()}"}}}`
let payload = {}
payload[`APNS_VOIP`] = voip_protocol_value
let params = {
'Message': JSON.stringify(payload),
'MessageAttributes': {
'AWS.SNS.MOBILE.APNS.PRIORITY': {
'DataType': 'String',
'StringValue': '10'
},
'AWS.SNS.MOBILE.APNS.PUSH_TYPE': {
'DataType': 'String',
'StringValue': 'voip'
},
},
'MessageStructure': 'json',
'TargetArn': endpointArn
}


Thanks a lot in advance!
Best Regards,
AlekT
This is very likely due to your application taking too long to start from a terminated state. When you receive an incoming VoIP push, you have mere seconds to respond and report the call to CallKit.

But, if your app is not running at the time, it will first go through the regular launch process, and before you receive the push notification, your applicationDidFinishLaunching() will be called. If you are taking too long there before returning from that method, then you could be running past the short time you are allowed before you are supposed to report the incoming call.

My suggestion would be to start examining applicationDidFinishLaunching() and see how long it takes to return. And find ways to optimize the startup time there if it is indeed taking more than just a few seconds.
Issues with IOS 13 VOIP Push Notifications - App Crashing when killed
 
 
Q