From 02a1bb223ffb14498513a669a23c8d9881dba14b Mon Sep 17 00:00:00 2001 From: HavenDV Date: Wed, 24 Jan 2024 06:04:25 +0400 Subject: [PATCH] docs: Fixed small issues. --- README.md | 6 ++++-- sample/MainPage.xaml.cs | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 459dc1a..a4c23b7 100644 --- a/README.md +++ b/README.md @@ -42,8 +42,10 @@ builder - Use through `BiometricAuthentication.Current` or using `IBiometricAuthentication` from DI: ```csharp -var request = new AuthenticationRequestConfiguration ("Prove you have fingers!", "Because without it you can't have access"); -var result = await BiometricAuthentication.Current.AuthenticateAsync(request); +var result = await BiometricAuthentication.Current.AuthenticateAsync( + new AuthenticationRequest( + title: "Prove you have fingers!", + reason: "Because without it you can't have access")); if (result.Authenticated) { // do secret stuff :) diff --git a/sample/MainPage.xaml.cs b/sample/MainPage.xaml.cs index 89d41be..1947f39 100644 --- a/sample/MainPage.xaml.cs +++ b/sample/MainPage.xaml.cs @@ -13,7 +13,8 @@ protected override async void OnAppearing() { base.OnAppearing(); - AuthenticationTypeLabel.Text = "Auth Type: " + await BiometricAuthentication.Current.GetAuthenticationTypeAsync(); + var type = await BiometricAuthentication.Current.GetAuthenticationTypeAsync(); + AuthenticationTypeLabel.Text = $"Auth Type: {type:G}"; } private async void OnAuthenticate(object sender, EventArgs e) @@ -43,7 +44,9 @@ private async Task AuthenticateAsync( StatusLabel.Text = ""; var result = await BiometricAuthentication.Current.AuthenticateAsync( - request: new AuthenticationRequest("My App", reason) + request: new AuthenticationRequest( + title: "My App", + reason: reason) { // all optional CancelTitle = cancel ?? string.Empty,