BelledonneCommunications / linphone-iphone

Linphone is a free VoIP and video softphone based on the SIP protocol. Mirror of linphone-iphone (git://git.linphone.org/linphone-iphone.git)
http://linphone.org
GNU General Public License v3.0
585 stars 349 forks source link

ios crashing the application and blocking next incoming calls #704

Open kiiskristo opened 4 years ago

kiiskristo commented 4 years ago

Hi,

I noticed that in your ProviderDelegate, provider.reportNewIncomingCall you are not calling completion that is given in

registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Void

This might lead to ios crashing the application and blocking all next incoming calls when the caller is blocked or device is in DND mode. It works when reportNewIncomingCall does not cause an error and callkit is reported, but when its errored it might cause serious problems

Raviojha62 commented 3 years ago

Hi @kiiskristo can you please help me how are you achieving the call notification when app is in background or terminated. i am using the latest code and it not working in these state

hatinfotech commented 3 years ago

I tried disabling background processing and the app got the notification for the next call.

kristohear commented 3 years ago

@hatinfotech background processing has nothing to do with DND(Do Not Disturb) mode, its callkit related issue when ios failes to show callkit then pushkit has to be notified according to apple guidelines. Even if it might work, it might crash and block incoming calls. We tested with big amount of customers and this became a serious issue. Link to apple guidelines how to implement pushkit and callkit: https://developer.apple.com/documentation/pushkit/responding_to_voip_notifications_from_pushkit

Notice code: // Report the call to CallKit, and let it display the call UI. callProvider?.reportNewIncomingCall(with: callUUID, update: callUpdate, completion: { (error) in if error == nil { // If the system allows the call to proceed, make a data record for it. let newCall = VoipCall(callUUID, phoneNumber: phoneNumber) self.callManager.addCall(newCall) } // Tell PushKit that the notification is handled. completion() })

Especially: // Tell PushKit that the notification is handled. completion()

This is important.