alexey.m
alexey.m

Reputation: 1349

LAContext UI on simulator

Does anybody knows what is UI presented on Simulator when you call

self._authContext = LAContext()
if self._authContext.canEvaluatePolicy(.deviceOwnerAuthentication,
                                           error: &authError)
{
    self._authContext.evaluatePolicy(...
}

It asks for iPhone passcode, but in some unusual manner. Whatever you type in leads to success. Here is screenshot: enter image description here

On device, if passcode is off you just don't pass canEvaluatePolicy

Is there a default UI to setup passcode if iPhone passcode is disabled?

Thanks!

Upvotes: 3

Views: 1365

Answers (2)

Lytic
Lytic

Reputation: 806

I'm not sure if this will help anyone.. but to trigger/test a success=false condition, you can press "enter" with an empty password string.

Upvotes: 0

nahung89
nahung89

Reputation: 8085

EDIT: I've not found any document from Apple yet, it's my assuming as described below.

It's fake UI for passcode authentication. On simulator, authContext.canEvaluatePolicy always response with true. Because of this, calling authContext.evaluatePolicy will open this UI above.

If you enable TouchID or FaceID on simulator, this UI will show up right after TouchID/FaceID fails in 3 times.

FYI: on simulator, you can use TouchID from Hardware > TouchID

enter image description here

Upvotes: 3

Related Questions