How to use the react-native-camera.default.checkDeviceAuthorizationStatus 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 soliury / noder-react-native / src / layouts / Login.js View on Github external
_onLoginPress () {
    const {ui, router, actions} = this.props
    if (ui.checkTokenPending) { return }
    if (Platform.OS !== 'web') {
      Platform.OS === 'android' ? router.toQRCode() : Camera.checkDeviceAuthorizationStatus()
        .then((isAuth) => {
          if (isAuth) {
            router.toQRCode()
          } else {
            actions.toast('请在设置中开启Noder对相机的访问')
          }
        })
        .catch(() => {
          actions.toast('获取相机访问权错误')
        })
    }
  }