From 534c8a1fb966332e6b57aed68bbd46de2f1bfb9f Mon Sep 17 00:00:00 2001 From: Nikolay Polukhin Date: Mon, 5 Mar 2018 14:29:34 +0400 Subject: [PATCH] Fix #65 (Android FingerprintManager not supported for API lower than 23) --- .../com/rnfingerprint/FingerprintAuthModule.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/android/src/main/java/com/rnfingerprint/FingerprintAuthModule.java b/android/src/main/java/com/rnfingerprint/FingerprintAuthModule.java index e96213cc..bff9c001 100644 --- a/android/src/main/java/com/rnfingerprint/FingerprintAuthModule.java +++ b/android/src/main/java/com/rnfingerprint/FingerprintAuthModule.java @@ -51,14 +51,14 @@ public String getName() { @ReactMethod public void isSupported(Callback reactErrorCallback, Callback reactSuccessCallback) { - keyguardManager = - (KeyguardManager) getCurrentActivity().getSystemService(Context.KEYGUARD_SERVICE); - fingerprintManager = - (FingerprintManager) getCurrentActivity().getSystemService(Context.FINGERPRINT_SERVICE); if(!isFingerprintAuthAvailable()) { - reactErrorCallback.invoke("Not supported."); + reactErrorCallback.invoke("Not supported."); } else { - reactSuccessCallback.invoke("Is supported."); + keyguardManager = + (KeyguardManager) getCurrentActivity().getSystemService(Context.KEYGUARD_SERVICE); + fingerprintManager = + (FingerprintManager) getCurrentActivity().getSystemService(Context.FINGERPRINT_SERVICE); + reactSuccessCallback.invoke("Is supported."); } return ; }