With App closed the call ends after the connecting state

Hi, I have a problem with the SendBird Calls when the ios app is closed.
When I receive a VoIP call notification, I accept it, and the app opens the VideoCallViewController but, immediately after the connection status, the vc is closed (the vc says that the call is completed). I struggle to debug it and I don’t understand why the call is closed immediately after the connection, any ideas?

Ah the call doesn’t seem to be finished, among the active apps I see that the call system view is active but both app and web show the call as completed.

I added an alert in the didEnd(_ call: DirectCall) [DirectCallDelegate] and i get the following result:

func didEnd(_ call: DirectCall) {
        let enderUserId = call.endedBy?.userId
        let myUserId = SendBirdCall.currentUser?.userId
        let iCloseTheCall = enderUserId == myUserId && myUserId != nil
        Alert.i.alertOnTopViewController(message: "Did I finish the phone call? \(iCloseTheCall) | End result: \(call.callLog?.endResult.rawValue ?? "no result")", style: .alert)
        guard let enderId = call.endedBy?.userId, let myId = SendBirdCall.currentUser?.userId, enderId != myId else { return }
        guard let call = SendBirdCall.getCall(forCallId: self.call.callId) else { return }

Screen Shot 2021-11-16 at 14.21.45

Hi @Andrea_Procucci,

Could you tell us the following version:

  • iOS Version
  • Calls SDK Version

Additionally, could you share with us the code on how you accept the call?

Hi @Tyler:
iOS Version: 15.1

  • SendBirdCalls (1.8.0):
    • SendBirdWebRTC (~> 1.4.0)
    • SendBirdSDK (3.0.238)
    • SendBirdUIKit (2.1.14):
      • SendBirdSDK (~> 3.0.226)
    • SendBirdWebRTC (1.4.0)

I use the code provided in the example of the direct call:
AppDelegate+SendBirdCallDelegate.swift (2.3 KB)
CXCallManager.swift (7.3 KB)
Calls work fine when the app is open, I don’t understand what automatically closes calls if they come when the app is closed.

Hi @Andrea_Procucci , Thanks for providing the code.
Could you try figuring out where the call.end() is being called? If we know where the call is being ended, it would be easier to find the error.