Skip to content

Commit

Permalink
Merge pull request NiklasMerz#10 from exxbrain/2.0.0-biometricpromt-a…
Browse files Browse the repository at this point in the history
…nd-consistent-callbacks

Add "biometric" type
  • Loading branch information
greaterking authored Oct 18, 2019
2 parents 9b594c6 + b2ab181 commit 6a64907
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/android/Fingerprint.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.app.Activity;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;

Expand Down Expand Up @@ -51,6 +52,8 @@ private void executeIsAvailable() {
PluginError error = canAuthenticate();
if (error != null) {
sendError(error);
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P){
sendSuccess("biometric");
} else {
sendSuccess("finger");
}
Expand Down
4 changes: 4 additions & 0 deletions www/Fingerprint.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ Fingerprint.prototype.BIOMETRIC_SCREEN_GUARD_UNSECURED = -110;
Fingerprint.prototype.BIOMETRIC_LOCKED_OUT = -111;
Fingerprint.prototype.BIOMETRIC_LOCKED_OUT_PERMANENT = -112;

// Biometric types
Fingerprint.prototype.BIOMETRIC_TYPE_FINGERPRINT = "finger";
Fingerprint.prototype.BIOMETRIC_TYPE_FACE = "face";
Fingerprint.prototype.BIOMETRIC_TYPE_COMMON = "biometric";

Fingerprint.prototype.show = function (params, successCallback, errorCallback) {
cordova.exec(
Expand Down

0 comments on commit 6a64907

Please sign in to comment.