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)
}
}
}