Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Ejemplo de cómo implementar la autenticación biométrica en aplicaciones Xamarin.Forms
using System;
using Xamarin.Forms;
using Plugin.Fingerprint;
using System.ComponentModel;
namespace FingerPrintPCL
{
[DesignTimeVisible(false)]
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
private async void btnFinger(object sender, EventArgs e)
{
var result = await CrossFingerprint.Current.IsAvailableAsync(true);
if (result)
{
var auth = await CrossFingerprint.Current.AuthenticateAsync("Toca el Sensor");
if (auth.Authenticated)
{
Resultado.Text = "¡Autenticado!";
}
else
{
Resultado.Text = "Huella digital no reconocida.";
}
}
else
{
await DisplayAlert("Oops", "Dispositivo no compatible.", "OK");
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.