Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

How to integrate selfie stick in Expo managed React-Native project?

$
0
0

I am building an application in react-native and managed by Expo. in one module i want to use Selfie stick or any other wireless device which can capture the photo. i have used expo-camera dependency. so what i want is whenever i am on camera screen and if someone clicks the button on selfie stick or any capturing device than photo must be captured and photo muse be sent on server.

This is how i am capturing right now.

const ImageSelector = (props) => {    const [pickedImage, setPickedImage] = useState()    const verifyPermissions = async () => {        const result = await Permissions.askAsync(Permissions.CAMERA, Permissions.CAMERA_ROLL)        if (result.status !== 'granted') {            Alert.alert('Infufficent Permission. You must allow Camera', [                { text: 'okay' }            ])            return false        }        return true    }    const takeImageHandler = async () => {        const hasPermission = await verifyPermissions()        if (hasPermission) {            const image = await ImagePicker.launchCameraAsync({                aspect: [1, 1]            })            setPickedImage(image.uri)            props.onImageTaken(image.uri)        }        else {            return        }    }    return (<View style={styles.imagePicker}><View style={styles.imagePreviw}>                {!pickedImage ? (<Text>No image picked Yet!</Text>) :                    (<Image style={styles.image} source={{ uri: pickedImage }} />)                }</View><Button                title="Take Image"                color={Colors.primary}                onPress={takeImageHandler}            /></View>    )}

Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>