react-native-camera: How do I test the functionality?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


react-native-camera: How do I test the functionality?



I am implementing the react-native-functionality functionality and trying to test it to make sure it works. This is my code:


react-native-functionality


return (
<View style={styles.container}>
<RNCamera
ref={ref => {
this.camera = ref;
}}
style = {styles.preview}
type={RNCamera.Constants.Type.back}
flashMode={RNCamera.Constants.FlashMode.on}
permissionDialogTitle={'Permission to use camera'}
permissionDialogMessage={'We need your permission to use your camera phone'}
/>
<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>
);



I am testing it on my MacBook, I run the app as react-native run-ios. When I get on the screen where I load the camera through the react-native-camera package, I only see a black screen with the SNAP button.


react-native run-ios


react-native-camera



When I click that button, nothing happens, but in the console, I see there has been logged a record of data - this is an example of that:



file:///Users/adam/Library/Developer/CoreSimulator/Devices/F1FDE7B1-40C6-4B83-9C17-C9EB74101FE2/data/Containers/Data/Application/03F010DB-B06B-4B3A-8216-19256F168A66/Library/Caches/Camera/BBF2EA02-2BD2-42EB-ADED-4303F01A1B9C.jpg



So as I understood from various articles, this is the cache where React Native defaultly saves all photos taken through this package. However, when I open that folder, I don't see there the image - how come? What am I missing? I looked on the package's permissions, but there are no instructions to set any permissions for iOS (OSX).



Also, one more thing - how can I test the camera from my laptop? I run the simulator, I click the SNAP button, but the only thing I'll always see is the black screen, because I cannot simulate on my MacBook the real phone device, am I right? So to test the camera functionality, do I only need to move the app to my phone and test it there?



Thank you in advance









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Arduino Mega cannot recieve any sketches, stk500_recv() programmer is not responding

Visual Studio Code: How to configure includePath for better IntelliSense results

C++ virtual function: Base class function is called instead of derived