react-native-biometric-verifier 0.0.59 → 0.0.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -221,14 +221,14 @@ const CaptureImageWithoutEdit = React.memo(
|
|
|
221
221
|
setIsInitializing(true);
|
|
222
222
|
setShowCamera(false);
|
|
223
223
|
|
|
224
|
-
const newCameraPermission = await Camera
|
|
224
|
+
const newCameraPermission = await Camera?.requestCameraPermission();
|
|
225
225
|
if (newCameraPermission === 'granted') {
|
|
226
|
-
let devices = await Camera
|
|
226
|
+
let devices = await Camera?.getAvailableCameraDevices();
|
|
227
227
|
|
|
228
228
|
// Retry once after short delay if no devices found
|
|
229
229
|
if (!devices || devices.length === 0) {
|
|
230
230
|
await new Promise((resolve) => setTimeout(resolve, 300));
|
|
231
|
-
devices = await Camera
|
|
231
|
+
devices = await Camera?.getAvailableCameraDevices();
|
|
232
232
|
}
|
|
233
233
|
|
|
234
234
|
if (!devices || devices.length === 0) {
|
|
@@ -432,12 +432,12 @@ const CaptureImageWithoutEdit = React.memo(
|
|
|
432
432
|
ref={cameraRef}
|
|
433
433
|
style={styles.camera}
|
|
434
434
|
device={cameraDevice}
|
|
435
|
-
isActive={showCamera && !isLoading}
|
|
435
|
+
isActive={cameraInitialized && showCamera && !isLoading}
|
|
436
436
|
photo={true}
|
|
437
|
-
format={format}
|
|
437
|
+
format={cameraDevice ? format : undefined}
|
|
438
438
|
codeScanner={showCodeScanner && cameraInitialized ? codeScanner : undefined}
|
|
439
439
|
enableZoomGesture={false}
|
|
440
|
-
lowLightBoost={cameraDevice
|
|
440
|
+
lowLightBoost={cameraDevice?.supportsLowLightBoost}
|
|
441
441
|
frameProcessor={
|
|
442
442
|
!showCodeScanner && cameraInitialized ? frameProcessor : undefined
|
|
443
443
|
}
|
|
@@ -450,7 +450,7 @@ const CaptureImageWithoutEdit = React.memo(
|
|
|
450
450
|
}}
|
|
451
451
|
exposure={0}
|
|
452
452
|
pixelFormat="yuv"
|
|
453
|
-
preset="
|
|
453
|
+
preset="photo"
|
|
454
454
|
orientation="portrait"
|
|
455
455
|
/>
|
|
456
456
|
) : (
|
package/src/index.js
CHANGED
|
@@ -49,7 +49,7 @@ const BiometricModal = React.memo(
|
|
|
49
49
|
|
|
50
50
|
// State
|
|
51
51
|
const [modalVisible, setModalVisible] = useState(false);
|
|
52
|
-
const [cameraType, setCameraType] = useState("
|
|
52
|
+
const [cameraType, setCameraType] = useState("back");
|
|
53
53
|
const [state, setState] = useState({
|
|
54
54
|
isLoading: false,
|
|
55
55
|
loadingType: Global.LoadingTypes.none,
|