I'm developing a VoIP app using CallKit and PushKit framworks and I’m facing a strange issue that happens only sometimes and more consistently in older devices, moreover it seems to happen only when the app is closed and the iPhone is locked. The problem is that when someone tries to call me, I receive the “incoming call” VoIP push but the CallKit UI do not show up until a second push is received (e.g. “hang up” notification). So, what happens is that the iPhone starts ringing when it receives the “hang up” notification and of course the caller has already hanged up.
My guess is that when the iPhone receives a push notification has only a limited amount of cpu time to report the incoming call and in certain circumstances the app exceeds this time and gets stopped, so when the second push arrives (“hang up” notification) the app continues the execution from where it left off and shows the incoming call UI. Is that possible?
Any help would be much appreciated!