如何解决Xamarin.AndroidBiometricPrompt:缺少setAllowedAuthenticators方法
我已经成功使用Nuget package published by Microsoft实现了BiometricPrompt的生物特征登录。
我希望我的应用仅允许使用强大的(第3类)生物识别硬件。本机文档指出我应该调用setAllowedAuthenticators()作为标志传递BIOMETRIC_STRONG。但是,我找不到PromptInfo构建器类的此方法。我的构建器代码目前看起来像这样。
var builder = new BiometricPrompt.PromptInfo.Builder()
.SetTitle(Alerts.AndroidFingerPrintDialog_SignIn)
.SetDescription(Alerts.AndroidFingerPrintDialog_FingerPrintPrompt)
.SetConfirmationRequired(false);
Nuget软件包中定义的方法在哪里(或者根本不支持)?
解决方法
setAllowedAuthenticators
已添加到 API级别30 。
因此,您需要使用Xamarin.Android 11.0及更高版本作为应用程序的编译目标,才能访问该功能。
2020年8月5日-Xamarin.Android 11.0.0.3
- 此版本包含在Visual Studio 2019版本16.7和Visual Studio 2019 for Mac版本8.7中。
re:https://docs.microsoft.com/en-us/xamarin/android/release-notes/11/11.0
注意:您将需要使用Runtime checks for Android versions为不同的API调用正确的BiometricPrompt.Builder
函数
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。