Open vinaykaitha opened 2 years ago
Like in this case:
@Override public void onAuthenticationError(int errorCode, @NonNull CharSequence errString) { super.onAuthenticationError(errorCode, errString); if (errorCode == BiometricPrompt.ERROR_NEGATIVE_BUTTON || errorCode == BiometricPrompt.ERROR_USER_CANCELED ) { WritableMap resultMap = new WritableNativeMap(); resultMap.putBoolean("success", false); resultMap.putString("error", "User cancellation"); this.promise.resolve(resultMap); } else { this.promise.reject(errString.toString(), errString.toString()); } }
this.promise.reject(errorCode.toString(), errString.toString()); and
this.promise.reject(errorCode.toString(), errString.toString());
WritableMap resultMap = new WritableNativeMap(); resultMap.putBoolean("success", false); resultMap.putString("errorCode", errorCode.toString()); this.promise.resolve(resultMap);
would have been more helpful.
So that we can show specific message to the user, like "You haven't enrolled for biometric on this device" etc.. Same goes for iOS.
This is a great idea to organize error messages in this project.
Gladly would accept a PR.
Like in this case:
this.promise.reject(errorCode.toString(), errString.toString());
andwould have been more helpful.
So that we can show specific message to the user, like "You haven't enrolled for biometric on this device" etc.. Same goes for iOS.