Created
May 7, 2022 17:00
-
-
Save andreas-nesheim/558bd3969c8a44808f4c0294e0220111 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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