How to use the expo.Permissions.CAMERA function in expo

To help you get started, we’ve selected a few expo 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 DefinitelyTyped / DefinitelyTyped / types / expo / expo-tests.tsx View on Github external
async () => {
    const result = await Permissions.askAsync(Permissions.CAMERA, Permissions.CONTACTS);

    result.status === 'granted';
    result.status === 'denied';
    result.status === 'undetermined';

    result.expires === 'never';
};
github DefinitelyTyped / DefinitelyTyped / types / expo / v31 / expo-tests.tsx View on Github external
async () => {
    const result = await Permissions.askAsync(Permissions.CAMERA, Permissions.CONTACTS);

    result.status === 'granted';
    result.status === 'denied';
    result.status === 'undetermined';

    result.expires === 'never';
};
github EvanBacon / pro-chat / client / src / components / chat / Actions.js View on Github external
_takePictureAsync = async () => {
    const { status } = await Permissions.askAsync(Permissions.CAMERA);
    if (status !== 'granted') {
      this.setState({
        errorMessage: 'Permission to access camera was denied',
      });
      return null;
    }

    const result = await ImagePicker.launchCameraAsync({
      allowsEditing: true,
      aspect: [4, 3],
    });

    console.log(result);

    if (!result.cancelled) {
      const storageUrl = await Fire.shared.uploadImageAsync(result.uri);
github nomadcoders / nomadgrapp / screens / CameraScreen / index.js View on Github external
componentWillMount = async () => {
    const camera = await Permissions.askAsync(Permissions.CAMERA);
    this.setState({
      hasCameraPermissions: camera.status === "granted"
    });
  };
github janaagaard75 / expo-and-typescript / src / BarCodeScannerScreen.tsx View on Github external
public async componentDidMount() {
    const { status } = await Permissions.askAsync(Permissions.CAMERA);
    this.setState({
      cameraPermission:
        status === "granted" ? PermissionState.Granted : PermissionState.Denied
    });
  }
github allenmichael / petunia / petunia-mobile / screens / HomeScreen.js View on Github external
async componentWillMount() {
      const { status } = await Permissions.askAsync(Permissions.CAMERA);
      this.setState({ hasCameraPermission: status === 'granted' })
    }
github Marwan01 / food-converter / screens / CameraScreen.js View on Github external
async componentWillMount() {
    const { status } = await Permissions.askAsync(Permissions.CAMERA);
    this.setState({ hasCameraPermission: status === 'granted' });
  }
github BlueWallet / BlueWallet / screen / wallets / scanQrWifLegacyAddress.js View on Github external
async componentWillMount() {
    const { status } = await Permissions.askAsync(Permissions.CAMERA);
    this.setState({
      hasCameraPermission: status === 'granted',
      onCameraReady: function() {
        alert('onCameraReady');
      },
      barCodeTypes: [Camera.Constants.BarCodeType.qr],
    });
  }
github BrightID / BrightID / brightID-expo / src / components / BarcodeScannerScreen.js View on Github external
async componentWillMount() {
    const { status } = await Permissions.askAsync(Permissions.CAMERA);
    this.setState({ hasCameraPermission: status === 'granted' });
  }
  handleBarCodeRead = ({ type, data }) => {
github vobi-io / markdown-editor / editor / src / TextEditor.js View on Github external
insertImage = async ({ type }) => {
    const { statusCamera } = await Permissions.askAsync(Permissions.CAMERA);
    if(statusCamera === 'granted') {
      alert('CAMERA Permission Error')
      return
    }
    
    const { statusLibrary } = await Permissions.askAsync(Permissions.CAMERA_ROLL);
    if(statusLibrary === 'granted') {
      alert('CAMERA_ROLL Permission Error')
      return
    }

    const pickerTypes = {
     ['Take Photo'] : 'launchCameraAsync',
     ['Browse Photo'] : 'launchImageLibraryAsync',
    }