別のアプリではカメラ音が鳴ることから、端末側の問題ではなさそうです。
以下のドキュメントに沿って標準的な実装をしておりますが、Androidの場合のみシャッターが鳴りません。
https://docs.expo.io/versions/latest/sdk/camera
iOSの方ではシャッターがなります。
宜しくお願い致します。
import React from 'react'; import { Text, View, TouchableOpacity } from 'react-native'; import { Camera, Permissions } from 'expo'; export default class CameraExample extends React.Component { state = { hasCameraPermission: null, type: Camera.Constants.Type.back, }; async componentWillMount() { const { status } = await Permissions.askAsync(Permissions.CAMERA); this.setState({ hasCameraPermission: status === 'granted' }); } render() { const { hasCameraPermission } = this.state; if (hasCameraPermission === null) { return <View />; } else if (hasCameraPermission === false) { return <Text>No access to camera</Text>; } else { return ( <View style={{ flex: 1 }}> <Camera style={{ flex: 1 }} type={this.state.type}> <View style={{ flex: 1, backgroundColor: 'transparent', flexDirection: 'row', }}> <TouchableOpacity style={{ flex: 0.1, alignSelf: 'flex-end', alignItems: 'center', }} onPress={() => { this.setState({ type: this.state.type === Camera.Constants.Type.back ? Camera.Constants.Type.front : Camera.Constants.Type.back, }); }}> <Text style={{ fontSize: 18, marginBottom: 10, color: 'white' }}> {' '}Flip{' '} </Text> </TouchableOpacity> </View> </Camera> </View> ); } } }
あなたの回答
tips
プレビュー