From 31056871dca4b04a703cb257d7221afc2b0b7e06 Mon Sep 17 00:00:00 2001 From: Ishpaul Singh Date: Wed, 25 Oct 2023 17:47:52 +0530 Subject: [PATCH 01/19] fix: wrong alert message for microphone permission error --- src/components/Onfido/index.native.js | 72 ++++++++++++++++++--------- src/languages/en.ts | 2 + src/languages/es.ts | 2 + 3 files changed, 52 insertions(+), 24 deletions(-) diff --git a/src/components/Onfido/index.native.js b/src/components/Onfido/index.native.js index 424e370b5fe6..c64151c65a49 100644 --- a/src/components/Onfido/index.native.js +++ b/src/components/Onfido/index.native.js @@ -1,7 +1,8 @@ import _ from 'underscore'; import lodashGet from 'lodash/get'; import React, {useEffect} from 'react'; -import {Alert, Linking} from 'react-native'; +import {Alert, Linking, Platform} from 'react-native'; +import {RESULTS, PERMISSIONS, checkMultiple} from 'react-native-permissions'; import {Onfido as OnfidoSDK, OnfidoCaptureType, OnfidoDocumentType, OnfidoCountryCode} from '@onfido/react-native-sdk'; import onfidoPropTypes from './onfidoPropTypes'; import CONST from '../../CONST'; @@ -39,30 +40,53 @@ function Onfido({sdkToken, onUserExit, onSuccess, onError}) { return; } - // Handle user camera permission on iOS and Android - if (_.contains([CONST.ONFIDO.ERROR.USER_CAMERA_PERMISSION, CONST.ONFIDO.ERROR.USER_CAMERA_DENINED, CONST.ONFIDO.ERROR.USER_CAMERA_CONSENT_DENIED], errorMessage)) { - Alert.alert( - translate('onfidoStep.cameraPermissionsNotGranted'), - translate('onfidoStep.cameraRequestMessage'), - [ - { - text: translate('common.cancel'), - onPress: () => onUserExit(), - }, - { - text: translate('common.settings'), - onPress: () => { - onUserExit(); - Linking.openSettings(); - }, - }, - ], - {cancelable: false}, - ); - return; - } + if (!_.isEmpty(errorMessage)) { + const micPermission = Platform.select({ + android: PERMISSIONS.ANDROID.RECORD_AUDIO, + ios: PERMISSIONS.IOS.MICROPHONE, + }); + const cameraPermission = Platform.select({ + android: PERMISSIONS.ANDROID.CAMERA, + ios: PERMISSIONS.IOS.CAMERA, + }); + checkMultiple([micPermission, cameraPermission]).then((statuses) => { + const isMicAllowed = statuses[micPermission] === RESULTS.GRANTED; + const isCameraAllowed = statuses[cameraPermission] === RESULTS.GRANTED; + let alertTitle = ''; + let alertMessage = ''; + if (!isMicAllowed) { + alertTitle = 'onfidoStep.microphonePermissionsNotGranted'; + alertMessage = 'onfidoStep.microphoneRequestMessage'; + } + if (!isCameraAllowed) { + alertTitle = 'onfidoStep.cameraPermissionsNotGranted'; + alertMessage = 'onfidoStep.cameraRequestMessage'; + } - onError(errorMessage); + if (!_.isEmpty(alertTitle) && !_.isEmpty(alertMessage)) { + Alert.alert( + translate(alertTitle), + translate(alertMessage), + [ + { + text: translate('common.cancel'), + onPress: () => onUserExit(), + }, + { + text: translate('common.settings'), + onPress: () => { + onUserExit(); + Linking.openSettings(); + }, + }, + ], + {cancelable: false}, + ); + return; + } + onError(errorMessage); + }); + } }); // Onfido should be initialized only once on mount // eslint-disable-next-line react-hooks/exhaustive-deps diff --git a/src/languages/en.ts b/src/languages/en.ts index 67cdb1c4cdab..c5ec69628c1d 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1221,6 +1221,8 @@ export default { genericError: 'There was an error while processing this step. Please try again.', cameraPermissionsNotGranted: 'Camera permissions not granted', cameraRequestMessage: 'You have not granted us camera access. We need access to complete verification.', + microphonePermissionsNotGranted: 'Microphone permissions not granted', + microphoneRequestMessage: 'You have not granted us microphone access. We need access to complete verification.', originalDocumentNeeded: 'Please upload an original image of your ID rather than a screenshot or scanned image.', documentNeedsBetterQuality: 'Your ID appears to be damaged or has missing security features. Please upload an original image of an undamaged ID that is entirely visible.', imageNeedsBetterQuality: "There's an issue with the image quality of your ID. Please upload a new image where your entire ID can be seen clearly.", diff --git a/src/languages/es.ts b/src/languages/es.ts index 3b8434ab7c3e..5fe314e0b375 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1239,6 +1239,8 @@ export default { genericError: 'Hubo un error al procesar este paso. Inténtalo de nuevo.', cameraPermissionsNotGranted: 'No has habilitado los permisos para acceder a la cámara', cameraRequestMessage: 'No has habilitado los permisos para acceder a la cámara. Necesitamos acceso para completar la verificaciôn.', + microphonePermissionsNotGranted: 'No has habilitado los permisos para acceder al micrófono', + microphoneRequestMessage: 'No has habilitado los permisos para acceder al micrófono. Necesitamos acceso para completar la verificaciôn.', originalDocumentNeeded: 'Por favor, sube una imagen original de tu identificación en lugar de una captura de pantalla o imagen escaneada.', documentNeedsBetterQuality: 'Parece que tu identificación esta dañado o le faltan características de seguridad. Por favor, sube una imagen de tu documento sin daños y que se vea completamente.', From ea5b6c9d9754c3460efd77c33c66543cbed46f1f Mon Sep 17 00:00:00 2001 From: Ishpaul Singh Date: Thu, 26 Oct 2023 15:50:21 +0530 Subject: [PATCH 02/19] added requested changes --- src/components/Onfido/index.native.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/components/Onfido/index.native.js b/src/components/Onfido/index.native.js index c64151c65a49..7d7d7ac7140d 100644 --- a/src/components/Onfido/index.native.js +++ b/src/components/Onfido/index.native.js @@ -1,7 +1,7 @@ import _ from 'underscore'; import lodashGet from 'lodash/get'; import React, {useEffect} from 'react'; -import {Alert, Linking, Platform} from 'react-native'; +import {Alert, Linking} from 'react-native'; import {RESULTS, PERMISSIONS, checkMultiple} from 'react-native-permissions'; import {Onfido as OnfidoSDK, OnfidoCaptureType, OnfidoDocumentType, OnfidoCountryCode} from '@onfido/react-native-sdk'; import onfidoPropTypes from './onfidoPropTypes'; @@ -9,6 +9,7 @@ import CONST from '../../CONST'; import Log from '../../libs/Log'; import FullscreenLoadingIndicator from '../FullscreenLoadingIndicator'; import useLocalize from '../../hooks/useLocalize'; +import getPlatform from '../../libs/getPlatform'; function Onfido({sdkToken, onUserExit, onSuccess, onError}) { const {translate} = useLocalize(); @@ -41,14 +42,10 @@ function Onfido({sdkToken, onUserExit, onSuccess, onError}) { } if (!_.isEmpty(errorMessage)) { - const micPermission = Platform.select({ - android: PERMISSIONS.ANDROID.RECORD_AUDIO, - ios: PERMISSIONS.IOS.MICROPHONE, - }); - const cameraPermission = Platform.select({ - android: PERMISSIONS.ANDROID.CAMERA, - ios: PERMISSIONS.IOS.CAMERA, - }); + const os = getPlatform(); + const micPermission = os === CONST.PLATFORM.IOS ? PERMISSIONS.IOS.MICROPHONE : PERMISSIONS.ANDROID.RECORD_AUDIO; + const cameraPermission = os === CONST.PLATFORM.IOS ? PERMISSIONS.IOS.CAMERA : PERMISSIONS.ANDROID.CAMERA; + checkMultiple([micPermission, cameraPermission]).then((statuses) => { const isMicAllowed = statuses[micPermission] === RESULTS.GRANTED; const isCameraAllowed = statuses[cameraPermission] === RESULTS.GRANTED; From c4bdd27ae289c2871d6b16ab479ab2fedd2519d8 Mon Sep 17 00:00:00 2001 From: Ishpaul Singh Date: Mon, 30 Oct 2023 17:11:47 +0530 Subject: [PATCH 03/19] fix conflicts --- src/components/Onfido/index.native.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Onfido/index.native.js b/src/components/Onfido/index.native.js index 7d7d7ac7140d..df136feb1ad5 100644 --- a/src/components/Onfido/index.native.js +++ b/src/components/Onfido/index.native.js @@ -1,7 +1,7 @@ -import _ from 'underscore'; -import lodashGet from 'lodash/get'; import React, {useEffect} from 'react'; import {Alert, Linking} from 'react-native'; +import _ from 'underscore'; +import lodashGet from 'lodash/get'; import {RESULTS, PERMISSIONS, checkMultiple} from 'react-native-permissions'; import {Onfido as OnfidoSDK, OnfidoCaptureType, OnfidoDocumentType, OnfidoCountryCode} from '@onfido/react-native-sdk'; import onfidoPropTypes from './onfidoPropTypes'; From a7dd5e30cd1ea2f719243725309a3bf983389de5 Mon Sep 17 00:00:00 2001 From: Ishpaul Singh Date: Mon, 30 Oct 2023 17:16:54 +0530 Subject: [PATCH 04/19] fix conflicts --- src/components/Onfido/index.native.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Onfido/index.native.js b/src/components/Onfido/index.native.js index 2a02a4c27ab9..6c8f1cd3c83a 100644 --- a/src/components/Onfido/index.native.js +++ b/src/components/Onfido/index.native.js @@ -2,13 +2,14 @@ import {OnfidoCaptureType, OnfidoCountryCode, OnfidoDocumentType, Onfido as Onfi import lodashGet from 'lodash/get'; import React, {useEffect} from 'react'; import {Alert, Linking} from 'react-native'; +import {checkMultiple, PERMISSIONS, RESULTS} from 'react-native-permissions'; import _ from 'underscore'; import FullscreenLoadingIndicator from '@components/FullscreenLoadingIndicator'; import useLocalize from '@hooks/useLocalize'; import Log from '@libs/Log'; import CONST from '@src/CONST'; import onfidoPropTypes from './onfidoPropTypes'; - +import getPlatform from '../../libs/getPlatform'; function Onfido({sdkToken, onUserExit, onSuccess, onError}) { const {translate} = useLocalize(); From 3d18adf7d73a3a15547c07358bae960ba5e57aea Mon Sep 17 00:00:00 2001 From: Ishpaul Singh Date: Mon, 30 Oct 2023 19:06:08 +0530 Subject: [PATCH 05/19] fix imports --- src/components/Onfido/index.native.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Onfido/index.native.js b/src/components/Onfido/index.native.js index 6c8f1cd3c83a..b6118f6ba9f2 100644 --- a/src/components/Onfido/index.native.js +++ b/src/components/Onfido/index.native.js @@ -9,7 +9,7 @@ import useLocalize from '@hooks/useLocalize'; import Log from '@libs/Log'; import CONST from '@src/CONST'; import onfidoPropTypes from './onfidoPropTypes'; -import getPlatform from '../../libs/getPlatform'; +import getPlatform from '@libs/getPlatform'; function Onfido({sdkToken, onUserExit, onSuccess, onError}) { const {translate} = useLocalize(); From 967569dfdc246c4dbc6a3d6360caf163933abf58 Mon Sep 17 00:00:00 2001 From: Ishpaul Singh Date: Wed, 1 Nov 2023 00:59:39 +0530 Subject: [PATCH 06/19] fix lint --- src/components/Onfido/index.native.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Onfido/index.native.js b/src/components/Onfido/index.native.js index b6118f6ba9f2..70cf3b5fde20 100644 --- a/src/components/Onfido/index.native.js +++ b/src/components/Onfido/index.native.js @@ -8,8 +8,8 @@ import FullscreenLoadingIndicator from '@components/FullscreenLoadingIndicator'; import useLocalize from '@hooks/useLocalize'; import Log from '@libs/Log'; import CONST from '@src/CONST'; -import onfidoPropTypes from './onfidoPropTypes'; import getPlatform from '@libs/getPlatform'; +import onfidoPropTypes from './onfidoPropTypes'; function Onfido({sdkToken, onUserExit, onSuccess, onError}) { const {translate} = useLocalize(); From 729f2641fe11af093d86c5a5ca219ca374c51f6f Mon Sep 17 00:00:00 2001 From: Ishpaul Singh Date: Wed, 1 Nov 2023 01:15:55 +0530 Subject: [PATCH 07/19] fix prettier difffs --- src/components/Onfido/index.native.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Onfido/index.native.js b/src/components/Onfido/index.native.js index 70cf3b5fde20..4750a1fe04c3 100644 --- a/src/components/Onfido/index.native.js +++ b/src/components/Onfido/index.native.js @@ -7,8 +7,8 @@ import _ from 'underscore'; import FullscreenLoadingIndicator from '@components/FullscreenLoadingIndicator'; import useLocalize from '@hooks/useLocalize'; import Log from '@libs/Log'; -import CONST from '@src/CONST'; import getPlatform from '@libs/getPlatform'; +import CONST from '@src/CONST'; import onfidoPropTypes from './onfidoPropTypes'; function Onfido({sdkToken, onUserExit, onSuccess, onError}) { From efe6754304f2ce64e5341f6b55ad89667b3131ab Mon Sep 17 00:00:00 2001 From: Ishpaul Singh Date: Thu, 2 Nov 2023 02:09:35 +0530 Subject: [PATCH 08/19] made change specific to ios --- src/components/Onfido/index.native.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/components/Onfido/index.native.js b/src/components/Onfido/index.native.js index 4750a1fe04c3..eb3af35525e2 100644 --- a/src/components/Onfido/index.native.js +++ b/src/components/Onfido/index.native.js @@ -6,8 +6,8 @@ import {checkMultiple, PERMISSIONS, RESULTS} from 'react-native-permissions'; import _ from 'underscore'; import FullscreenLoadingIndicator from '@components/FullscreenLoadingIndicator'; import useLocalize from '@hooks/useLocalize'; -import Log from '@libs/Log'; import getPlatform from '@libs/getPlatform'; +import Log from '@libs/Log'; import CONST from '@src/CONST'; import onfidoPropTypes from './onfidoPropTypes'; @@ -41,14 +41,11 @@ function Onfido({sdkToken, onUserExit, onSuccess, onError}) { return; } - if (!_.isEmpty(errorMessage)) { - const os = getPlatform(); - const micPermission = os === CONST.PLATFORM.IOS ? PERMISSIONS.IOS.MICROPHONE : PERMISSIONS.ANDROID.RECORD_AUDIO; - const cameraPermission = os === CONST.PLATFORM.IOS ? PERMISSIONS.IOS.CAMERA : PERMISSIONS.ANDROID.CAMERA; - - checkMultiple([micPermission, cameraPermission]).then((statuses) => { - const isMicAllowed = statuses[micPermission] === RESULTS.GRANTED; - const isCameraAllowed = statuses[cameraPermission] === RESULTS.GRANTED; + const os = getPlatform(); + if (!_.isEmpty(errorMessage) && os === CONST.PLATFORM.IOS) { + checkMultiple([PERMISSIONS.IOS.MICROPHONE, PERMISSIONS.IOS.CAMERA]).then((statuses) => { + const isMicAllowed = statuses[PERMISSIONS.IOS.CAMERA] === RESULTS.GRANTED; + const isCameraAllowed = statuses[PERMISSIONS.IOS.CAMERA] === RESULTS.GRANTED; let alertTitle = ''; let alertMessage = ''; if (!isMicAllowed) { @@ -83,6 +80,8 @@ function Onfido({sdkToken, onUserExit, onSuccess, onError}) { } onError(errorMessage); }); + } else { + onError(errorMessage); } }); // Onfido should be initialized only once on mount From f46a771f168b08e7ca92683400402ad3d47807d5 Mon Sep 17 00:00:00 2001 From: Ishpaul Singh Date: Fri, 3 Nov 2023 12:03:13 +0530 Subject: [PATCH 09/19] fix no modal error on mic permission --- src/components/Onfido/index.native.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Onfido/index.native.js b/src/components/Onfido/index.native.js index eb3af35525e2..80fcfd2c9d47 100644 --- a/src/components/Onfido/index.native.js +++ b/src/components/Onfido/index.native.js @@ -44,7 +44,7 @@ function Onfido({sdkToken, onUserExit, onSuccess, onError}) { const os = getPlatform(); if (!_.isEmpty(errorMessage) && os === CONST.PLATFORM.IOS) { checkMultiple([PERMISSIONS.IOS.MICROPHONE, PERMISSIONS.IOS.CAMERA]).then((statuses) => { - const isMicAllowed = statuses[PERMISSIONS.IOS.CAMERA] === RESULTS.GRANTED; + const isMicAllowed = statuses[PERMISSIONS.IOS.MICROPHONE] === RESULTS.GRANTED; const isCameraAllowed = statuses[PERMISSIONS.IOS.CAMERA] === RESULTS.GRANTED; let alertTitle = ''; let alertMessage = ''; From b1c9a56da3aad983270ec57d9da52715d8206a2f Mon Sep 17 00:00:00 2001 From: Ishpaul Singh Date: Fri, 10 Nov 2023 02:09:03 +0530 Subject: [PATCH 10/19] changes copy for alert message in english --- src/components/Onfido/index.native.js | 2 ++ src/languages/en.ts | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/Onfido/index.native.js b/src/components/Onfido/index.native.js index 80fcfd2c9d47..422ab60681e5 100644 --- a/src/components/Onfido/index.native.js +++ b/src/components/Onfido/index.native.js @@ -79,6 +79,8 @@ function Onfido({sdkToken, onUserExit, onSuccess, onError}) { return; } onError(errorMessage); + }).catch(() => { + onError(errorMessage); }); } else { onError(errorMessage); diff --git a/src/languages/en.ts b/src/languages/en.ts index 1a0226db39f6..4e1436d9acdb 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1217,10 +1217,10 @@ export default { tryAgain: 'Try again', verifyIdentity: 'Verify identity', genericError: 'There was an error while processing this step. Please try again.', - cameraPermissionsNotGranted: 'Camera permissions not granted', - cameraRequestMessage: 'You have not granted us camera access. We need access to complete verification.', - microphonePermissionsNotGranted: 'Microphone permissions not granted', - microphoneRequestMessage: 'You have not granted us microphone access. We need access to complete verification.', + cameraPermissionsNotGranted: 'Enable Camera Access', + cameraRequestMessage: 'We need access to your camera to complete bank account verification. Please enable via Settings > New Expensify', + microphonePermissionsNotGranted: 'Enable Microphone Access', + microphoneRequestMessage: 'We need access to your microphone to complete bank account verification. Please enable via Settings > New Expensify', originalDocumentNeeded: 'Please upload an original image of your ID rather than a screenshot or scanned image.', documentNeedsBetterQuality: 'Your ID appears to be damaged or has missing security features. Please upload an original image of an undamaged ID that is entirely visible.', imageNeedsBetterQuality: "There's an issue with the image quality of your ID. Please upload a new image where your entire ID can be seen clearly.", From 5f44d6b6e159d4bc72a7af8943067cdace981697 Mon Sep 17 00:00:00 2001 From: Ishpaul Singh Date: Fri, 10 Nov 2023 02:20:37 +0530 Subject: [PATCH 11/19] fix lint --- src/components/Onfido/index.native.js | 76 ++++++++++++++------------- 1 file changed, 39 insertions(+), 37 deletions(-) diff --git a/src/components/Onfido/index.native.js b/src/components/Onfido/index.native.js index 422ab60681e5..71ae2309c8e3 100644 --- a/src/components/Onfido/index.native.js +++ b/src/components/Onfido/index.native.js @@ -43,45 +43,47 @@ function Onfido({sdkToken, onUserExit, onSuccess, onError}) { const os = getPlatform(); if (!_.isEmpty(errorMessage) && os === CONST.PLATFORM.IOS) { - checkMultiple([PERMISSIONS.IOS.MICROPHONE, PERMISSIONS.IOS.CAMERA]).then((statuses) => { - const isMicAllowed = statuses[PERMISSIONS.IOS.MICROPHONE] === RESULTS.GRANTED; - const isCameraAllowed = statuses[PERMISSIONS.IOS.CAMERA] === RESULTS.GRANTED; - let alertTitle = ''; - let alertMessage = ''; - if (!isMicAllowed) { - alertTitle = 'onfidoStep.microphonePermissionsNotGranted'; - alertMessage = 'onfidoStep.microphoneRequestMessage'; - } - if (!isCameraAllowed) { - alertTitle = 'onfidoStep.cameraPermissionsNotGranted'; - alertMessage = 'onfidoStep.cameraRequestMessage'; - } + checkMultiple([PERMISSIONS.IOS.MICROPHONE, PERMISSIONS.IOS.CAMERA]) + .then((statuses) => { + const isMicAllowed = statuses[PERMISSIONS.IOS.MICROPHONE] === RESULTS.GRANTED; + const isCameraAllowed = statuses[PERMISSIONS.IOS.CAMERA] === RESULTS.GRANTED; + let alertTitle = ''; + let alertMessage = ''; + if (!isMicAllowed) { + alertTitle = 'onfidoStep.microphonePermissionsNotGranted'; + alertMessage = 'onfidoStep.microphoneRequestMessage'; + } + if (!isCameraAllowed) { + alertTitle = 'onfidoStep.cameraPermissionsNotGranted'; + alertMessage = 'onfidoStep.cameraRequestMessage'; + } - if (!_.isEmpty(alertTitle) && !_.isEmpty(alertMessage)) { - Alert.alert( - translate(alertTitle), - translate(alertMessage), - [ - { - text: translate('common.cancel'), - onPress: () => onUserExit(), - }, - { - text: translate('common.settings'), - onPress: () => { - onUserExit(); - Linking.openSettings(); + if (!_.isEmpty(alertTitle) && !_.isEmpty(alertMessage)) { + Alert.alert( + translate(alertTitle), + translate(alertMessage), + [ + { + text: translate('common.cancel'), + onPress: () => onUserExit(), }, - }, - ], - {cancelable: false}, - ); - return; - } - onError(errorMessage); - }).catch(() => { - onError(errorMessage); - }); + { + text: translate('common.settings'), + onPress: () => { + onUserExit(); + Linking.openSettings(); + }, + }, + ], + {cancelable: false}, + ); + return; + } + onError(errorMessage); + }) + .catch(() => { + onError(errorMessage); + }); } else { onError(errorMessage); } From 326245417c90bb3fe13127389e564eb29bbb3cf4 Mon Sep 17 00:00:00 2001 From: Ishpaul Singh Date: Thu, 16 Nov 2023 04:00:11 +0530 Subject: [PATCH 12/19] copy updated --- src/languages/en.ts | 6 +++--- src/languages/es.ts | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 4e1436d9acdb..dafe17c7b5b2 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -976,7 +976,7 @@ export default { label: 'Use Device Settings', }, }, - chooseThemeBelowOrSync: 'Choose a theme below, or sync with your device settings.', + chooseThemeBelowOrSync: 'Choose a theme below, or syn c with your device settings.', }, signInPage: { expensifyDotCash: 'New Expensify', @@ -1218,9 +1218,9 @@ export default { verifyIdentity: 'Verify identity', genericError: 'There was an error while processing this step. Please try again.', cameraPermissionsNotGranted: 'Enable Camera Access', - cameraRequestMessage: 'We need access to your camera to complete bank account verification. Please enable via Settings > New Expensify', + cameraRequestMessage: 'We need access to your camera to complete bank account verification. Please enable via Settings > New Expensify.', microphonePermissionsNotGranted: 'Enable Microphone Access', - microphoneRequestMessage: 'We need access to your microphone to complete bank account verification. Please enable via Settings > New Expensify', + microphoneRequestMessage: 'We need access to your microphone to complete bank account verification. Please enable via Settings > New Expensify.', originalDocumentNeeded: 'Please upload an original image of your ID rather than a screenshot or scanned image.', documentNeedsBetterQuality: 'Your ID appears to be damaged or has missing security features. Please upload an original image of an undamaged ID that is entirely visible.', imageNeedsBetterQuality: "There's an issue with the image quality of your ID. Please upload a new image where your entire ID can be seen clearly.", diff --git a/src/languages/es.ts b/src/languages/es.ts index 53990e64a343..2eb6f008259b 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1234,10 +1234,10 @@ export default { tryAgain: 'Intentar otra vez', verifyIdentity: 'Verificar identidad', genericError: 'Hubo un error al procesar este paso. Inténtalo de nuevo.', - cameraPermissionsNotGranted: 'No has habilitado los permisos para acceder a la cámara', - cameraRequestMessage: 'No has habilitado los permisos para acceder a la cámara. Necesitamos acceso para completar la verificaciôn.', - microphonePermissionsNotGranted: 'No has habilitado los permisos para acceder al micrófono', - microphoneRequestMessage: 'No has habilitado los permisos para acceder al micrófono. Necesitamos acceso para completar la verificaciôn.', + cameraPermissionsNotGranted: 'Permiso para acceder a la cámara', + cameraRequestMessage: 'Necesitamos acceso a tu cámara para completar la verificación de tu cuenta de banco. Por favor habilita los permisos en Configuración > Nuevo Expensify.', + microphonePermissionsNotGranted: 'Permiso para acceder al micrófono', + microphoneRequestMessage: 'Necesitamos acceso a tu micrófono para completar la verificación de tu cuenta de banco. Por favor habilita los permisos en Configuración > Nuevo Expensify.', originalDocumentNeeded: 'Por favor, sube una imagen original de tu identificación en lugar de una captura de pantalla o imagen escaneada.', documentNeedsBetterQuality: 'Parece que tu identificación esta dañado o le faltan características de seguridad. Por favor, sube una imagen de tu documento sin daños y que se vea completamente.', From 59917010d6a0fb0f150c3838b9072a68a84ae680 Mon Sep 17 00:00:00 2001 From: Ishpaul Singh Date: Thu, 16 Nov 2023 04:06:21 +0530 Subject: [PATCH 13/19] fix lint --- src/languages/es.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/languages/es.ts b/src/languages/es.ts index a98f84f97f74..898b7c14feec 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1236,7 +1236,8 @@ export default { cameraPermissionsNotGranted: 'Permiso para acceder a la cámara', cameraRequestMessage: 'Necesitamos acceso a tu cámara para completar la verificación de tu cuenta de banco. Por favor habilita los permisos en Configuración > Nuevo Expensify.', microphonePermissionsNotGranted: 'Permiso para acceder al micrófono', - microphoneRequestMessage: 'Necesitamos acceso a tu micrófono para completar la verificación de tu cuenta de banco. Por favor habilita los permisos en Configuración > Nuevo Expensify.', + microphoneRequestMessage: + 'Necesitamos acceso a tu micrófono para completar la verificación de tu cuenta de banco. Por favor habilita los permisos en Configuración > Nuevo Expensify.', originalDocumentNeeded: 'Por favor, sube una imagen original de tu identificación en lugar de una captura de pantalla o imagen escaneada.', documentNeedsBetterQuality: 'Parece que tu identificación esta dañado o le faltan características de seguridad. Por favor, sube una imagen de tu documento sin daños y que se vea completamente.', From 058488200ce20c2e8603d07282248c2dc247f378 Mon Sep 17 00:00:00 2001 From: Ishpaul Singh Date: Tue, 21 Nov 2023 22:37:42 +0530 Subject: [PATCH 14/19] fix title for error message --- src/languages/en.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 92e4d4ff24ed..f2384c2064b2 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1216,9 +1216,9 @@ export default { tryAgain: 'Try again', verifyIdentity: 'Verify identity', genericError: 'There was an error while processing this step. Please try again.', - cameraPermissionsNotGranted: 'Enable Camera Access', + cameraPermissionsNotGranted: 'Enable camera access', cameraRequestMessage: 'We need access to your camera to complete bank account verification. Please enable via Settings > New Expensify.', - microphonePermissionsNotGranted: 'Enable Microphone Access', + microphonePermissionsNotGranted: 'Enable microphone access', microphoneRequestMessage: 'We need access to your microphone to complete bank account verification. Please enable via Settings > New Expensify.', originalDocumentNeeded: 'Please upload an original image of your ID rather than a screenshot or scanned image.', documentNeedsBetterQuality: 'Your ID appears to be damaged or has missing security features. Please upload an original image of an undamaged ID that is entirely visible.', From 8c73e7d7c181cc142aa65989d598c98286984251 Mon Sep 17 00:00:00 2001 From: Ishpaul Singh <104348397+ishpaul777@users.noreply.github.com> Date: Mon, 11 Dec 2023 16:05:45 +0530 Subject: [PATCH 15/19] Update src/components/Onfido/index.native.js Co-authored-by: Situ Chandra Shil <108292595+situchan@users.noreply.github.com> --- src/components/Onfido/index.native.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/Onfido/index.native.js b/src/components/Onfido/index.native.js index 71ae2309c8e3..c0e690f9ee40 100644 --- a/src/components/Onfido/index.native.js +++ b/src/components/Onfido/index.native.js @@ -41,8 +41,7 @@ function Onfido({sdkToken, onUserExit, onSuccess, onError}) { return; } - const os = getPlatform(); - if (!_.isEmpty(errorMessage) && os === CONST.PLATFORM.IOS) { + if (!_.isEmpty(errorMessage) && getPlatform() === CONST.PLATFORM.IOS) { checkMultiple([PERMISSIONS.IOS.MICROPHONE, PERMISSIONS.IOS.CAMERA]) .then((statuses) => { const isMicAllowed = statuses[PERMISSIONS.IOS.MICROPHONE] === RESULTS.GRANTED; From 924247d7ef1e8232131c28f01587f8f910fca9d0 Mon Sep 17 00:00:00 2001 From: Ishpaul Singh <104348397+ishpaul777@users.noreply.github.com> Date: Mon, 11 Dec 2023 16:06:21 +0530 Subject: [PATCH 16/19] Update src/components/Onfido/index.native.js Co-authored-by: Situ Chandra Shil <108292595+situchan@users.noreply.github.com> --- src/components/Onfido/index.native.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/Onfido/index.native.js b/src/components/Onfido/index.native.js index c0e690f9ee40..b0a0b3f4a466 100644 --- a/src/components/Onfido/index.native.js +++ b/src/components/Onfido/index.native.js @@ -48,13 +48,12 @@ function Onfido({sdkToken, onUserExit, onSuccess, onError}) { const isCameraAllowed = statuses[PERMISSIONS.IOS.CAMERA] === RESULTS.GRANTED; let alertTitle = ''; let alertMessage = ''; - if (!isMicAllowed) { - alertTitle = 'onfidoStep.microphonePermissionsNotGranted'; - alertMessage = 'onfidoStep.microphoneRequestMessage'; - } if (!isCameraAllowed) { alertTitle = 'onfidoStep.cameraPermissionsNotGranted'; alertMessage = 'onfidoStep.cameraRequestMessage'; + } else if (!isMicAllowed) { + alertTitle = 'onfidoStep.microphonePermissionsNotGranted'; + alertMessage = 'onfidoStep.microphoneRequestMessage'; } if (!_.isEmpty(alertTitle) && !_.isEmpty(alertMessage)) { From 099c7fa9c4dcd459241ab9df370959553094ccf3 Mon Sep 17 00:00:00 2001 From: Ishpaul Singh <104348397+ishpaul777@users.noreply.github.com> Date: Mon, 11 Dec 2023 16:08:28 +0530 Subject: [PATCH 17/19] Update CONST.ts --- src/CONST.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/CONST.ts b/src/CONST.ts index 6f1fe37f661d..36b9272acfff 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1090,11 +1090,6 @@ const CONST = { USER_CANCELLED: 'User canceled flow.', USER_TAPPED_BACK: 'User exited by clicking the back button.', USER_EXITED: 'User exited by manual action.', - USER_CAMERA_DENINED: 'Onfido.OnfidoFlowError', - USER_CAMERA_PERMISSION: 'Encountered an error: cameraPermission', - // eslint-disable-next-line max-len - USER_CAMERA_CONSENT_DENIED: - 'Unexpected result Intent. It might be a result of incorrect integration, make sure you only pass Onfido intent to handleActivityResult. It might be due to unpredictable crash or error. Please report the problem to android-sdk@onfido.com. Intent: null \n resultCode: 0', }, }, From b85636fb06808b27cbcca2187cdaf670cd1f7e76 Mon Sep 17 00:00:00 2001 From: Ishpaul Singh <104348397+ishpaul777@users.noreply.github.com> Date: Mon, 11 Dec 2023 16:35:49 +0530 Subject: [PATCH 18/19] Update src/languages/en.ts Co-authored-by: Situ Chandra Shil <108292595+situchan@users.noreply.github.com> --- src/languages/en.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index d27bcabdb920..c58d3b807aa5 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1014,7 +1014,8 @@ export default { label: 'Use Device Settings', }, }, - chooseThemeBelowOrSync: 'Choose a theme below, or syn c with your device settings.', + chooseThemeBelowOrSync: 'Choose a theme below, or sync with your device settings.', +`` }, signInPage: { expensifyDotCash: 'New Expensify', From 8c0b10bc4b163adefb062d273e74834d0e39fe43 Mon Sep 17 00:00:00 2001 From: Ishpaul Singh <104348397+ishpaul777@users.noreply.github.com> Date: Mon, 11 Dec 2023 16:36:36 +0530 Subject: [PATCH 19/19] Update src/languages/en.ts Co-authored-by: Situ Chandra Shil <108292595+situchan@users.noreply.github.com> --- src/languages/en.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index c58d3b807aa5..b0265a4bc5b4 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1015,7 +1015,6 @@ export default { }, }, chooseThemeBelowOrSync: 'Choose a theme below, or sync with your device settings.', -`` }, signInPage: { expensifyDotCash: 'New Expensify',