IOS 16 callkit answering in lockscreen

i have a problem when answering call on via callkit ui if my app is in lockscreen and killed state. I am currently using skyway for the audio and video call

issue description

  • when the call receiveranswersr the via callkit ui , the receiver will not receive an answer till he will visit the app .

this issue doesn't happen on ios 15 version

I realise this is a little late but we ran in to a similar issue and managed to solve it by making sure the device is unlocked before fulfilling the CXAnswerCallAction.

The code looked like this:


func provider(_ provider: CXProvider, perform action: CXAnswerCallAction) {
	checkUnlockedAndFulfill(action: action, counter: 0)
}

private func checkUnlockedAndFulfill(action: CXAnswerCallAction, counter: Int) {
	if UIApplication.shared.isProtectedDataAvailable {
		action.fulfill()
	} else if counter > 180 { // fail if waiting for more then 3 minutes
		action.fail()
	} else {
		DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
			self.checkUnlockedAndFulfill(action: action, counter: counter + 1)
		}
	}
}

Hopefully this helps.

Hello Team

   Facing same issue tried above solution not work for me please help.

Hi there, I got this problem even IOS < 16, any new solution now?

Hello, maybe I'm a bit late to the party but what worked for me when the app is killed and user delays unlocking for seconds is @Radther answer but adding UIApplication.shared.applicationState == .active as AND condition

func provider(_ provider: CXProvider, perform action: CXAnswerCallAction) {
	checkUnlockedAndFulfill(action: action, counter: 0)
}

private func checkUnlockedAndFulfill(action: CXAnswerCallAction, counter: Int) {

	if UIApplication.shared.isProtectedDataAvailable,
     UIApplication.shared.applicationState == .active // <-- This
    {
      // Add your videocall view to view hierarchy here, not before 
		  action.fulfill()

	} else if counter > 30 { // Timeout in seconds

		action.fail()

	} else {

		DispatchQueue.main.asyncAfter(deadline: .now() + 1) {

			self.checkUnlockedAndFulfill(action: action, counter: counter + 1)
		}
	}
}
IOS 16 callkit answering in lockscreen
 
 
Q