N
N
NONAME82018-03-14 14:23:43
iOS
NONAME8, 2018-03-14 14:23:43

How to enter password in system notification when FaceID didn't work?

I do authorization using FaceID and TouchID, depending on the device.
When a face or finger is not recognized, an automatic system notification always pops up when it prompts me to try again or enter a password.
But this "Enter Password" button doesn't work and just closes the notification when you click it.
5aa90629e93c8352539215.png5aa9063172a4e565880654.png
How to program this button and read the password from it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
doublench21, 2018-03-14
@NONAME8

https://www.prolificinteractive.com/2015/01/26/tut...
I think here you will find all the questions that concern you, including password verification.
Let's start here and take a look:

case deviceOwnerAuthenticationWithBiometrics
Indicates that the device owner must authenticate using biometry. // Юзаем только биометрию

case deviceOwnerAuthentication
Indicates that the device owner can authenticate using biometry or the device password. //Юзаем биометрия и если её нет, то Пароль
Details on each of the methods can be found there. Details of the 2nd variant
You have the 1st variant in your code, change it to the 2nd one:
if contex.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: nil) {
            contex.evaluatePolicy(LAPolicy.deviceOwnerAuthentication, localizedReason: "Use TouchID", reply: { wasSuccessful, _ in

                if wasSuccessful {
                    print("Все получилось")
                    let mainStoryboard = UIStoryboard(name: "Main", bundle: nil)
                    let homeVC = mainStoryboard.instantiateViewController(withIdentifier: "HomeVC")
                    self.navigationController?.pushViewController(homeVC, animated: true)
                } else {
                    print("Что-то пошло не так")
                }
            })
        }

With this approach, the following will appear: 5aa933ca7eb2a419650612.jpeg
Well, I forgot to add, if the type of verification is left unchanged, that is, the 1st method, then when you click on the enter password button, you need to catch a type error. userFallback
With this approach, after you have caught, you are already free to do whatever you want. Remove control or something. BUT, you cannot display the screen with buttons for entering the pincode yourself. You need to implement your own, or find ready-made ones that you can find. And it is better to use a regular alert with an input field.
Authentication was canceled because the user tapped the fallback button in the authentication dialog, but no fallback is available for the authentication
Details here https://developer.apple.com/documentation/localaut...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question