简体   繁体   English

在自己的Android应用中使用默认的面部解锁功能

[英]Use default face Unlock functionality in own Android app

I want to enable fingerprint and face unlock for my application. 我想为我的应用程序启用指纹和面部解锁。 I have fingerprint unlock code and it is working fine if the user is already registered his fingerprint. 我有指纹解锁代码,如果用户已经注册了指纹,它可以正常工作。

I want to enable the same feature for face unlock as well. 我也想为面部解锁启用相同的功能。 If the user has already enrolled his face id, then he should be able to authenticate the app with face unlock. 如果用户已经注册了他的面部ID,则他应该能够使用面部解锁对应用进行身份验证。 I don't want to create any library here, I just want to invoke the device face unlock app and authenticate. 我不想在这里创建任何库,我只想调用设备面部解锁应用程序并进行身份验证。

Starting with Android P, you can use the BiometricPrompt API - it will automatically support whichever biometric authentication mechanism is physically present on the user's phone. 从Android P开始,您可以使用BiometricPrompt API-它会自动支持用户手机上实际存在的任何生物特征认证机制。

See this blog post for a brief overview of the feature, and the docs for how to implement this. 有关此功能的简要概述,请参见此博客文章 ,以及有关如何实现此功能的文档 This blog post contains a walk-through of all the steps to implement this. 这篇博客文章包含实现此目标的所有步骤的演练。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM