Jul. 21st, 2024
2024年 6月 16日

Post: LAContext.biometryType returns LABiometryType.none in iOS 11

LAContext.biometryType returns LABiometryType.none in iOS 11

Published 12:12 Dec 18, 2017.

Created by @ezra. Categorized in #Programming, and tagged as #iOS.

Source format: Markdown

Table of Content

I'm trying to support FaceID in my application.

Running LAContect().canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &error) returns true, so I expect that the device has biometrics enabled (which it has, it is an iPhone X with iOS 11.2.1 with FaceID enrolled and working for unlock).

So I expect to get LABiometryType.typeTouchID when later checking LAContext.biometryType, but as the title says it returns LABiometryType.none.

Auctully, we need to first call canEvaluatePolicy... in order to get the biometry type. That is, if you're just doing LAContext().biometryType then you'll always get none back. You would first need to call canEvaluatePolicy... on that instance, and then biometryType should have a non-none value (assuming the device has biometry support, and the user has enabled it).

Pinned Message
I'm looking for a SOFTWARE PROJECT DIRECTOR / SOFTWARE R&D DIRECTOR position in a fresh and dynamic company. I would like to gain the right experience and extend my skills while working in great teams and big projects.
Feel free to contact me.
For more information, please view online résumé or download PDF
本人正在寻求任职 软件项目经理 / 软件技术经理 岗位的机会, 希望加⼊某个新鲜⽽充满活⼒的公司。
如有意向请随时 与我联系
更多信息请 查阅在线简历下载 PDF