2

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

Le Trong Triet
  • 101
  • 1
  • 10
  • When do you want to take the Passcode/TouchID from the user? – Salman Ghumsani Aug 16 '17 at 05:49
  • @SalmanGhumsani I would like to ask the passcode from user after he/she accepted the call ( just like Whatsapp or FB messenger video call ) from lockscreen (not from the active state) – Le Trong Triet Aug 16 '17 at 05:50
  • So, what is the problem are you facing? – Salman Ghumsani Aug 16 '17 at 05:52
  • So, there are 2 cases. 1st, application is active or background without lock screen -> no need to ask passcode. 2nd, app is in background and lockscreen -> ask passcode to navigate. However, right now, without asking passcode, after users accepted the call, nothing happens :( – Le Trong Triet Aug 16 '17 at 05:54
  • 1
    I think you have to update your question with full of description. – Salman Ghumsani Aug 16 '17 at 05:55
  • Any luck with this use case , i guess we cant present biometrics when the app is still in background – Rango Feb 01 '21 at 13:53

0 Answers0