Skip to content

Instantly share code, notes, and snippets.

@kevalpatel2106
Created October 18, 2016 09:33
Show Gist options
  • Save kevalpatel2106/f1e062ae73b40815a8e6fab5c3997c29 to your computer and use it in GitHub Desktop.
Save kevalpatel2106/f1e062ae73b40815a8e6fab5c3997c29 to your computer and use it in GitHub Desktop.
@Override
public void onNoFingerPrintHardwareFound() {
//Device does not have finger print scanner.
}
@Override
public void onNoFingerPrintRegistered() {
//There are no finger prints registered on this device.
}
@Override
public void onBelowMarshmallow() {
//Device running below API 23 version of android that does not support finger print authentication.
}
@Override
public void onAuthSuccess(FingerprintManager.CryptoObject cryptoObject) {
//Authentication sucessful.
}
@Override
public void onAuthFailed(int errorCode, String errorMessage) {
switch (errorCode) { //Parse the error code for recoverable/non recoverable error.
case AuthErrorCodes.CANNOT_RECOGNIZE_ERROR:
//Cannot recognize the fingerprint scanned.
break;
case AuthErrorCodes.NON_RECOVERABLE_ERROR:
//This is not recoverable error. Try other options for user authentication. like pin, password.
break;
case AuthErrorCodes.RECOVERABLE_ERROR:
//Any recoverable error. Display message to the user.
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment