At first, when you run the app for the first time and go to the camera it launches the Permission modal on android or ios with the don't allow and allow options.
The package used is react-native-camera. It has a property called notAuthorizedView that you can return any view you want. What I want to do is to enable the camera or grant access to it in the notAuthorizedView which appears when not allowing the camera.
export default class MyCamera extends React.Component { constructor(props) { super(props); this.state = { uri:'' }; } render() { return (<View style={styles.container}><RNCamera ref={ref => { this.camera = ref; }} style={styles.preview} type={RNCamera.Constants.Type.back} flashMode={RNCamera.Constants.FlashMode.on} notAuthorizedView={<View><Text>YOU ARE NOT AUTHORIZED TO USE THE CAMERA</Text><Button onPress={()=>{Alert.alert('SET CAMERA STATUS TO READY')}}/></View> } permissionDialogTitle={'Permission to use camera'} permissionDialogMessage={'We need your permission to use your camera phone'} onGoogleVisionBarcodesDetected={({ barcodes }) => { console.log(barcodes); }} /><View style={{ flex: 0, flexDirection: 'row', justifyContent: 'center' }}><TouchableOpacity onPress={this.takePicture.bind(this)} style={styles.capture}><Text style={{ fontSize: 14 }}> SNAP </Text></TouchableOpacity></View></View> ); } goToConcern = () => { this.props.navigation.navigate('Concern', {uriPhoto: this.state.uri}) }; takePicture = async function() { if (this.camera) { const options = { quality: 0.5, base64: true }; const data = await this.camera.takePictureAsync(options) console.log(data.uri); console.log(data); this.setState({uri:data.uri}) } };}