Android Question FingerPrint Auth_Complete Question

incendio

Well-Known Member
Licensed User
Longtime User
Hello,

I tried fingerprint library from https://www.b4x.com/android/forum/threads/fingerprint-authentication.72500/ with real device on Oreo 8.0.

Changed a code for sub Auth_Complete to be like this
B4X:
Sub Auth_Complete (Success As Boolean, ErrorMessage As String)
   If Success Then
       ToastMessageShow("You have been authenticated!!!", True)
   Else
       fingerprint.Cancel
       ToastMessageShow($"Error: ${ErrorMessage}"$, True)
       Log(ErrorMessage)
   End If
End Sub

If scan succeded, the app worked OK, message "You have been authenticated!!!" appeared, but if scan failed, fingerprint cancel and the error message never called.

Any idea why it didn't work as expected?
 

incendio

Well-Known Member
Licensed User
Longtime User
I changed Sub Auth_Complete in FingerPrintManager.bas to like this
B4X:
Private Sub Auth_Complete (Success As Boolean, ErrorCode As Int, ErrorMessage As String)
    ToastMessageShow("Fingerprint Completed.", True)
    If ErrorCode = 5 Then Return 'cancel
    CallSub3(mTarget, mEventName & "_complete", Success, ErrorMessage)
End Sub

If FingerPrint scan successded, message "Fingerprint Completed." showed, but if FingerPrint scan failed, this message didn't show.

I guest a failed scan is not considered as a complete event so this event is never triggered.
 
Upvote 0

incendio

Well-Known Member
Licensed User
Longtime User
You must be able to read the logs. Connect with B4A-Bridge and run your app in debug mode. Or in release mode with #BridgeLogger: True.
See my post #6, I don't think there is any log caused Sub Auth_Complete in FingerPrintManager.bas never triggered on a failed scan.
 
Upvote 0
Top