diff --git a/src/NativeReactNativeBiometrics.ts b/src/NativeReactNativeBiometrics.ts index 80f6178..1a205b5 100644 --- a/src/NativeReactNativeBiometrics.ts +++ b/src/NativeReactNativeBiometrics.ts @@ -84,7 +84,7 @@ export interface Spec extends TurboModule { error?: string; }>; verifyKeySignature( - keyAlias: string, + keyAlias: string | null, data: string, promptTitle?: string, promptSubtitle?: string, diff --git a/src/index.tsx b/src/index.tsx index 1a8d4e9..74dc88a 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -269,12 +269,13 @@ export function verifyKeySignature( cancelButtonText?: string, returnAuthType?: boolean ): Promise { + const resolvedKeyAlias = keyAlias || null; logger.debug('Verifying key signature', 'verifyKeySignature', { keyAlias, dataLength: data.length, }); return ReactNativeBiometrics.verifyKeySignature( - keyAlias, + resolvedKeyAlias, data, promptTitle, promptSubtitle, @@ -341,6 +342,8 @@ export function signWithOptions( returnAuthType, } = options; + const resolvedKeyAlias = keyAlias || null; + logger.debug('Signing with options', 'signWithOptions', { keyAlias, dataLength: data.length, @@ -361,7 +364,7 @@ export function signWithOptions( // On Android, use the new method with options if (Platform.OS === 'android') { return ReactNativeBiometrics.verifyKeySignatureWithOptions( - keyAlias, + resolvedKeyAlias, data, promptTitle, promptSubtitle, @@ -388,7 +391,7 @@ export function signWithOptions( // On iOS, use the standard method with inputEncoding return ReactNativeBiometrics.verifyKeySignatureWithEncoding( - keyAlias, + resolvedKeyAlias, data, promptTitle, promptSubtitle,