I am working with a project requires VOIP and video call. Right now, I implemented the PushKit for initialising CallKit. I would like to ask the user for Passcode/TouchID (because after the user accepts the call, it will navigate application to video call controller). However, I searched online and found non-related topics.
There are 2 cases.
1st: application is active or background but not lockscreen -> navigate to the call viewcontroller
2nd: application is background/inactive with lockscreen -> need to ask for passcode for navigation.
My current problem is: if device is locked and the user accepted the call from lockscreen -> nothing happens and my app is still in background.
Can anyone give me a hand, please ?
Below is my current code: (i add this snippet on CXCallActionAnswer)
let context = LAContext()
var err: NSError?
if context.canEvaluatePolicy(.deviceOwnerAuthentication, error: &err) {
context.evaluatePolicy(.deviceOwnerAuthentication, localizedReason: "Active Session", reply: { (good, error) in
if good {
}else {
print("Cannot auth with passcode")
}
})
}
Thanks