How to use the expo-permissions.CAMERA function in expo-permissions

To help you get started, we’ve selected a few expo-permissions examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tensorflow / tfjs / tfjs-react-native / integration_rn59 / components / webcam / webcam_demo.tsx View on Github external
async componentDidMount() {
    await this.styler.init();
    const { status } = await Permissions.askAsync(Permissions.CAMERA);
    this.setState({
      hasCameraPermission: status === 'granted',
      isLoading: false
    });
  }
github SCasarotto / casarotto-chat / src / pages / Setup / Setup.js View on Github external
handleTakeImage = () => {
		Permissions.askAsync(Permissions.CAMERA_ROLL, Permissions.CAMERA)
			.then((response) => {
				const { status, expires, permissions } = response
				if (status === 'granted') {
					ImagePicker.launchCameraAsync({
						allowsEditing: true,
						aspect: [1, 1],
						base64: true,
						quality: 0.5,
					})
						.then((response) => {
							if (!response.cancelled) {
								this.props.uploadImage(response.uri)
							}
						})
						.catch((error) => console.log(error))
				}
github lightninglabs / lightning-app / src / component / qrcode-scanner.js View on Github external
async componentDidMount() {
    const { status } = await Permissions.askAsync(Permissions.CAMERA);
    this.setState({ hasCameraPermission: status === 'granted' });
  }
github expo / expo / home / utils / PermissionUtils.js View on Github external
export async function requestCameraAysnc() {
  return await controlledPromptAsync(
    Permissions.CAMERA,
    'In order to take photos you need to grant access to the camera'
  );
}
github EvanBacon / Instagram / screens / CameraScreen.js View on Github external
const ConnectedCameraScreen = connect(({ camera, permissions }) => ({
  camera,
  hasPermission:
    permissions[Permissions.CAMERA] === 'granted' &&
    permissions[Permissions.AUDIO_RECORDING] === 'granted',
}))(CameraScreen);
github keybase / client / shared / common-adapters / qr-scanner.native.tsx View on Github external
const getPermissionsGranted = async () => {
      const {status} = await Permissions.askAsync(Permissions.CAMERA)
      setHasCameraPermission(status === 'granted')
    }
    getPermissionsGranted()
github FaridSafi / react-native-gifted-chat / example-expo / mediaUtils.js View on Github external
export async function takePictureAsync(onSend) {
  if (await getPermissionAsync(Permissions.CAMERA)) {
    const result = await ImagePicker.launchCameraAsync({
      allowsEditing: true,
      aspect: [4, 3],
    })

    if (!result.cancelled) {
      onSend([{ image: result.uri }])
      return result.uri
    }
  }
}
github janaagaard75 / expo-and-typescript / src / CameraScreen.tsx View on Github external
public async componentWillMount() {
    const { status } = await Permissions.askAsync(Permissions.CAMERA);

    this.setState({
      hasPermissionToCamera: status === "granted"
    });
  }