react native ios QRCodeScanner error ( camera not authorized )

Viewed 822

I'm using "react-native": "0.63.2", "react-native-camera": "^3.37.0",

'camera not authorized' is the error displayed when the camera is launched

same is true with different camera libraries, but default camera works normally

I've added:

{ NSCameraUsageDescription NSPhotoLibraryUsageDescription NSMicrophoneUsageDescription NSPhotoLibraryAddUsageDescription } to ios/project/Info.plist

and also tried:

cameraProps={{captureAudio: false}}

but its not working. Any insights will be much appreciated. Thank you.

1 Answers

Same thing happened with me.

I noted that in one place I have check platform condition using single equal operator by mistake like

paddingTop: (Platform.OS = 'android'
                  ? 16
                  : 4)

then after changed it to (replacing single equal with double equal while platform condition matching)

   paddingTop: (Platform.OS == 'android'
                      ? 16)

                  : 4)
Related