react-native-qrcode-scanner icon indicating copy to clipboard operation
react-native-qrcode-scanner copied to clipboard

Must give NSMicrophoneUsageDescription

Open handoff opened this issue 6 years ago • 4 comments
trafficstars

What's happening?

Just upgraded the package, and now the app crashes with log text

This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSMicrophoneUsageDescription key with a string value explaining to the user how the app uses this data.

Howcome the scanner needs the microphone? I think many users will think this is kind of fishy. Can this requirement be disabled?

How can it be reproduced?

I am just doing

<QRCodeScanner
  onRead={this.onSuccess.bind(this)}
  reactivate
  reactivateTimeout={1000}
  showMarker
/>

Build details?

"react-native-camera": "^1.8.0"
"react-native-qrcode-scanner": "^1.1.2"

handoff avatar Jan 17 '19 19:01 handoff

This is due to changes in the react-native-camera package. For the full fix, you need to add the NSMicrophoneUsageDescription key as mentioned above and then set the cameraProps={{captureAudio: false}} as noted in https://github.com/moaazsidat/react-native-qrcode-scanner/issues/160

jinchung avatar Jan 19 '19 04:01 jinchung

@jinchung We have the same problem. Can you please use the solution provided below, as there is no reason for a qr code scanner to trigger the microphone permissions?

Instead of checkDeviceAuthorizationStatus have you tried checkVideoAuthorizationStatus? This seems to prompt for just the Camera Access and not the microphone.

Source: https://github.com/react-native-community/react-native-camera/issues/446

afilp avatar Jan 23 '19 11:01 afilp

I had the same issue in https://github.com/airsecure/airsecure and didn't want to create all the extra permissions fields for our users to worry about, so created this fork of the permissions library that will only work for camera and therefore, only requires the camera justification https://github.com/textileio/react-native-permissions

andrewxhill avatar Mar 04 '19 07:03 andrewxhill

@andrewxhill Thanks! I wonder if this could be a setting (option) in this package or at the react-native-permissions package, what do you think?

afilp avatar Mar 07 '19 21:03 afilp