我的 react-native 应用中的原生相机。
为此,我使用 https://github.com/coretech/react-native-camera
将这个模块设置到我的项目中后,我的应用程序崩溃了,它在控制台中显示了这样一条错误消息
[访问] 此应用已崩溃,因为它试图在没有使用说明的情况下访问隐私敏感数据。应用的 Info.plist 必须包含一个 NSCameraUsageDescription 键和一个向用户解释应用如何使用此数据的字符串值。
甚至我在 info.plist 中添加了用于在 iOS 中访问相机的键。
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Your message to user when the photo library is accessed for the first time</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>uses photos</string>
<key>NSCameraUsageDescription</key>
<string>uses camera</string>
我的系统配置:npm 6.1.0,react-native-cli:2.0.1,react-native:0.55.4,Mac OS 10.13.5,Xcode 9.3
最佳答案
关于ios - iPhone 相机在 react-native 0.55.4 中不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51325562/