我正在尝试使用xarmians博客中的示例中的touch id,但它给了我一个错误。如果它的原因使用模拟器注册的测试触摸通过,我不会不。但它失败了,另一个问题是我正在使用故事板,所以我的问题是我如何推动视觉控制器是succsess并找出为什么触摸id是faling。
partial void touchId(UIButton sender)
{
//Lets double check the device supports Touch ID
if (context.CanEvaluatePolicy(LAPolicy.DeviceOwnerAuthenticationWithBiometrics, out error))
{
var replyHandler = new LAContextReplyHandler((success, error) =>
{
InvokeOnMainThread(() =>
{
if (success)
{
var newVC = new UIViewController();
PresentViewController(newVC, true, null);
}
else
{
var alert = new UIAlertView("OOPS!", "Something went wrong.", null, "Oops", null);
alert.Show();
}
});
});
context.EvaluatePolicy(LAPolicy.DeviceOwnerAuthenticationWithBiometrics, "Logging in with Touch ID", replyHandler);
}
else
{
var alert = new UIAlertView("Error", "TouchID not available", null, "BOOO!", null);
alert.Show();
}
}
它正在进入应用程序的这一行
var alert = new UIAlertView("OOPS!", "Something went wrong.", null, "Oops", null);
答案 0 :(得分:0)
对于其他被困的人,我必须做以下事情。
var homeScreen = (UIViewController)Storyboard.InstantiateViewController("welcome");
PresentViewController(homeScreen, true, () => { });
确保我想要显示的视图控制器的故事板ID设置为欢迎