Skip to content

Commit

Permalink
docs: Fixed small issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed Jan 24, 2024
1 parent e9d8127 commit 02a1bb2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 :)
Expand Down
7 changes: 5 additions & 2 deletions sample/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 02a1bb2

Please sign in to comment.