Return null instead of throwing for getSupportedBiometryType on android

This commit is contained in:
Joel Arvidsson 2018-02-25 19:23:36 +01:00
parent d6544520f2
commit 0b1b1d3395
2 changed files with 4 additions and 5 deletions

View File

@ -87,11 +87,7 @@ export function canImplyAuthentication(options?: SecureOptions): Promise {
*/ */
export function getSupportedBiometryType(): Promise { export function getSupportedBiometryType(): Promise {
if (Platform.OS !== 'ios') { if (Platform.OS !== 'ios') {
return Promise.reject( return Promise.resolve(null);
new Error(
`getSupportedBiometryType() is not supported on ${Platform.OS} yet`
)
);
} }
return RNKeychainManager.getSupportedBiometryType(); return RNKeychainManager.getSupportedBiometryType();
} }

View File

@ -22,6 +22,9 @@ declare module 'react-native-keychain' {
options?: SecureOptions options?: SecureOptions
): Promise<boolean>; ): Promise<boolean>;
function getSupportedBiometryType(
): Promise<string>;
function setSecurePassword( function setSecurePassword(
username: string, username: string,
password: string, password: string,