diff --git a/src/components/AttachmentPicker/index.native.js b/src/components/AttachmentPicker/index.native.js index b786b5cf5923..379c8697e3e4 100644 --- a/src/components/AttachmentPicker/index.native.js +++ b/src/components/AttachmentPicker/index.native.js @@ -1,6 +1,7 @@ /** * The react native image/document pickers work for iOS/Android, but we want to wrap them both within AttachmentPicker */ +import {Alert, Linking} from 'react-native'; import RNImagePicker from 'react-native-image-picker'; import RNDocumentPicker from 'react-native-document-picker'; import PropTypes from 'prop-types'; @@ -51,6 +52,24 @@ function showDocumentPicker(callback) { function show(callback) { RNImagePicker.showImagePicker(imagePickerOptions, (response) => { if (response.error) { + if (response.error === 'Camera permissions not granted') { + Alert.alert( + // eslint-disable-next-line max-len + 'ExpensifyCash does not have access to your camera. To enable access, tap Settings and turn on Camera.', + '', + [ + { + text: 'Cancel', + style: 'cancel', + }, + { + text: 'Settings', + onPress: () => Linking.openURL('app-settings:'), + }, + ], + {cancelable: false}, + ); + } console.debug(`Error during attachment selection: ${response.error}`); } else if (response.customButton) { showDocumentPicker(callback);