Skip to content

Commit

Permalink
Fix xamarin in biometric authgear#78
Browse files Browse the repository at this point in the history
  • Loading branch information
roxk committed May 19, 2022
1 parent 212af31 commit 1c558e6
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions strategies/biometric.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,27 +131,33 @@ try {
{% tab title="Xamarin" %}
```csharp
// We will need the options for the other biometric api
var ios = new BiometricOptionsIos {
var ios = new BiometricOptionsIos
{
LocalizedReason = "Use biometric to authenticate",
Constraint = BiometricAccessConstraintIos.BiometryAny,
AccessConstraint = BiometricAccessConstraintIos.BiometricAny,
};
var android = new BiometricOptionsAndroid {
var android = new BiometricOptionsAndroid
{
Title = "Biometric Authentication",
Subtitle = "Biometric authentication",
Description = "Use biometric to authenticate",
NegativeButtonText = "Cancel",
Constraint = BiometricAccessConstraintAndroid.BiometricOnly,
AccessConstraint = BiometricAccessConstraintAndroid.BiometricOnly,
InvalidatedByBiometricEnrollment = false,
};
var biometricOptions = new BiometricOptions {
var biometricOptions = new BiometricOptions
{
Ios = ios,
Android = android
};
try {
try
{
// check if current device supports biometric login
authgear.EnsureBiometricIsSupported(biometricOptions);
// biometric login is supported
} catch (e) {
}
catch
{
// biometric login is not supported
}
```
Expand Down

0 comments on commit 1c558e6

Please sign in to comment.