Skip to content

Commit ab9696c

Browse files
[MOO-2020] chore: upgrade react-native-biometrics dependancy (#305)
2 parents 33a6587 + 415acda commit ab9696c

6 files changed

Lines changed: 25 additions & 27 deletions

File tree

configs/e2e/native_dependencies.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@
1717
"react-native-localize": "3.2.1",
1818
"react-native-image-picker": "7.2.3",
1919
"react-native-permissions": "5.4.2",
20-
"react-native-webview": "13.13.2"
20+
"react-native-webview": "13.13.2",
21+
"@sbaiahmed1/react-native-biometrics": "0.4.0"
2122
}

packages/jsActions/mobile-resources-native/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1414
- Updated react-native from version 0.75.4 to 0.77.3.
1515
- We migrated from react-native-file-viewer to react-native-file-viewer-turbo for new architecture compatibility
1616
- File viewer now uses modal to display content
17+
- We migrated from react-native-biometrics to @sbaiahmed1/react-native-biometrics for new architecture compatibility
1718

1819

1920
## [10.0.0] Native Mobile Resources - 2025-3-31

packages/jsActions/mobile-resources-native/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
"@notifee/react-native": "9.1.8",
3030
"@react-native-camera-roll/camera-roll": "7.4.0",
3131
"@react-native-firebase/messaging": "17.3.0",
32+
"@sbaiahmed1/react-native-biometrics": "0.4.0",
3233
"@swan-io/react-native-browser": "0.4.1",
3334
"fbjs": "3.0.4",
3435
"mime": "3.0.0",
35-
"react-native-biometrics": "3.0.1",
3636
"react-native-blob-util": "0.21.2",
3737
"react-native-device-info": "14.0.4",
3838
"react-native-file-viewer-turbo": "0.6.0",

packages/jsActions/mobile-resources-native/src/authentication/BiometricAuthentication.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// - the code between BEGIN USER CODE and END USER CODE
66
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
77
// Other code you write will be lost the next time you deploy the project.
8-
import ReactNativeBiometrics from "react-native-biometrics";
8+
import { simplePrompt } from "@sbaiahmed1/react-native-biometrics";
99

1010
// BEGIN EXTRA CODE
1111
// END EXTRA CODE
@@ -16,13 +16,10 @@ import ReactNativeBiometrics from "react-native-biometrics";
1616
*/
1717
export async function BiometricAuthentication(reason?: string): Promise<boolean> {
1818
// BEGIN USER CODE
19-
// Documentation https://github.com/smallcase/react-native-simple-biometrics
19+
// Documentation https://github.com/sbaiahmed1/react-native-biometrics
2020

21-
const rnBiometrics = new ReactNativeBiometrics();
22-
23-
return rnBiometrics
24-
.simplePrompt({ promptMessage: reason ?? "" })
25-
.then(() => true)
21+
return simplePrompt(reason ?? "")
22+
.then(result => result.success)
2623
.catch(() => false);
2724

2825
// END USER CODE

packages/jsActions/mobile-resources-native/src/authentication/IsBiometricAuthenticationSupported.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// - the code between BEGIN USER CODE and END USER CODE
66
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
77
// Other code you write will be lost the next time you deploy the project.
8-
import ReactNativeBiometrics from "react-native-biometrics";
8+
import { isSensorAvailable } from "@sbaiahmed1/react-native-biometrics";
99

1010
// BEGIN EXTRA CODE
1111
// END EXTRA CODE
@@ -15,12 +15,9 @@ import ReactNativeBiometrics from "react-native-biometrics";
1515
*/
1616
export async function IsBiometricAuthenticationSupported(): Promise<boolean> {
1717
// BEGIN USER CODE
18-
// Documentation https://github.com/smallcase/react-native-simple-biometrics
18+
// Documentation https://github.com/sbaiahmed1/react-native-biometrics
1919

20-
const rnBiometrics = new ReactNativeBiometrics();
21-
22-
return rnBiometrics
23-
.isSensorAvailable()
20+
return isSensorAvailable()
2421
.then(result => result.available)
2522
.catch(() => false);
2623

pnpm-lock.yaml

Lines changed: 14 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)