Skip to content

Commit

Permalink
Revise android module to return the biometry type supported (instead …
Browse files Browse the repository at this point in the history
…of boolean)
  • Loading branch information
Adam Shurson authored and Adam Shurson committed Apr 13, 2019
1 parent 2e7c4bc commit 83d18af
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions TouchID.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export default {
(error, code) => {
return reject(createError(config, error, code));
},
success => {
return resolve(true);
(biometryType) => {
return resolve(biometryType);
}
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ public void isSupported(final Callback reactErrorCallback, final Callback reactS

int result = isFingerprintAuthAvailable();
if (result == FingerprintAuthConstants.IS_SUPPORTED) {
reactSuccessCallback.invoke("Is supported.");
// TODO: once this package supports Android's Face Unlock,
// implement a method to find out which type of biometry
// (not just fingerprint) is actually supported
reactSuccessCallback.invoke("Fingerprint");
} else {
reactErrorCallback.invoke("Not supported.", result);
}
Expand Down
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ declare module 'react-native-touch-id' {
/**
* The supported biometry type
*/
type BiometryType = 'FaceID' | 'TouchID';
type BiometryType = 'FaceID' | 'TouchID' | 'Fingerprint';

/**
* Base config to pass to `TouchID.isSupported` and `TouchID.authenticate`
Expand Down

0 comments on commit 83d18af

Please sign in to comment.