gpt4 book ai didi

ios - NSCameraUsageDescription 无效

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:13:21 26 4
gpt4 key购买 nike

我正在尝试打开用户的摄像头,但每当我尝试打开摄像头时,我都会收到此错误消息,“该应用程序已崩溃,因为它试图在没有使用说明的情况下访问隐私敏感数据。该应用程序的 Info.plist必须包含一个 NSCameraUsageDescription 键和一个字符串值,向用户解释应用程序如何使用此数据。”我已经在 info.plist 文件中添加了 Privacy - Camera Usage Description 以及诸如“我需要使用你的相机”之类的值,但我仍然收到此错误。这是我的 info.plist 源代码

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Needed to receive your current location.</string>
<key>NSCameraUsageDescription</key>
<string>Need to use camera for AR</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

***我找到了解决方案。我必须进入“信息”并在自定义 IOS 目标属性中添加隐私 key

最佳答案

奇怪的是,在 iOS 10 之后,您必须定义对所有硬件的访问权限。您很可能会错过“隐私-麦克风使用说明”。切换到“管理器”并查看设备上的崩溃报告并添加此处列出的所有隐私错误。

关于ios - NSCameraUsageDescription 无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42797763/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com