How to use the react-native-camera.checkVideoAuthorizationStatus function in react-native-camera

To help you get started, we’ve selected a few react-native-camera 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 keybase / client / shared / login / register / code-page / qr / index.ios.js View on Github external
async _requestCameraPermission() {
    try {
      const permissionGranted = await Camera.checkVideoAuthorizationStatus()
      this.setState({permissionGranted})
    } catch (err) {
      console.warn("Can't get camera permissions", err)
      this.setState({permissionGranted: false})
    }
  }
github l3wi / iotaMobile / app / routes / qrcode.js View on Github external
componentDidMount() {
    Camera.checkVideoAuthorizationStatus().then(data => {
      console.log(data);
      this.setState({ allowed: data });
    });
  }
github keybase / client / shared / login / register / code-page / qr / index.ios.js View on Github external
async _requestCameraPermission() {
    try {
      const permissionGranted = await Camera.checkVideoAuthorizationStatus()
      this.setState({permissionGranted})
    } catch (err) {
      logger.warn("Can't get camera permissions", err)
      this.setState({permissionGranted: false})
    }
  }
github sovrin-foundation / connector-app / app / qr-code / qr-code.js View on Github external
checkCameraAuthorization = () => {
    if (Platform.OS === 'ios') {
      Camera.checkVideoAuthorizationStatus()
        .then((authorization: boolean) => {
          if (authorization) {
            this.setHasCameraAccessPermission()
          } else {
            this.setNoCameraAccessPermission()
          }
        })
        .catch(this.setNoCameraAccessPermission)
    } else {
      PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.CAMERA, {
        title: 'App Camera Permission',
        message:
          'App needs access to your camera ' +
          'so you can scan QR codes and form connections.',
      })
        .then(result => {