Skip to content

Instantly share code, notes, and snippets.

@andreas-nesheim
Created May 7, 2022 17:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreas-nesheim/558bd3969c8a44808f4c0294e0220111 to your computer and use it in GitHub Desktop.
Save andreas-nesheim/558bd3969c8a44808f4c0294e0220111 to your computer and use it in GitHub Desktop.
using Plugin.Fingerprint.Abstractions;
namespace MauiBiometrics;
public partial class MainPage : ContentPage
{
private readonly IFingerprint fingerprint;
public MainPage(IFingerprint fingerprint)
{
InitializeComponent();
this.fingerprint = fingerprint;
}
private async void OnCounterClicked(object sender, EventArgs e)
{
var request = new AuthenticationRequestConfiguration("Prove you have fingers!", "Because without it you can't have access");
var result = await fingerprint.AuthenticateAsync(request);
if (result.Authenticated)
{
await DisplayAlert("Authenticated!", "Access granted", "Cool beans");
}
else
{
await DisplayAlert("Not authenticated!", "Access denied", "aww");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment