Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("1")
Biometric.Initialize(Me, "Authenticate")
Dim res As String = Biometric.CanAuthenticate
Label1.text = $"CanAuthenticate: ${res}"$
If res = "SUCCESS" Then
Biometric.Show("Please authenticate")
Wait For Authenticate_Complete (Success As Boolean, ErrorMessage As String)
Label1.text = Label1.text & $"
Authenticate: ${Success}
ErrorMessage: ${ErrorMessage}"$
If Success Then
'EXECUTE APP
Msgbox2Async("run program", "", "OK", "", "", Null, False)
Wait For Msgbox_Result (Result As Int)
ExitApplication
Else
'CLOSE APP
Msgbox2Async("ACCESS ERROR - CLOSE PROGRAM", "", "OK", "", "", Null, False)
Wait For Msgbox_Result (Result As Int)
ExitApplication
End If
Else
'EXECUTE APP
Msgbox2Async("run program", "", "OK", "", "", Null, False)
Wait For Msgbox_Result (Result As Int)
ExitApplication
End If
End Sub