当我试图向用户询问Xcode 9 Beta中的位置时,我得到了以下错误。我试着在使用中添加“隐私-位置-使用描述”“和”隐私-位置使用描述“info.plist中的描述,但仍然会出现相同的错误。
这个应用程序试图访问隐私敏感数据,而不需要使用描述。应用程序的Info.plist必须同时包含NSLocationAlwaysAndWhenInUseUsageDescription和NSLocationWhenInUseUsageDescription键以及字符串值,向用户解释应用程序如何使用这些数据
当我尝试添加“总隐私-位置”和在使用中使用描述“”时,它将自动被重命名为info.plist中的“隐私-位置使用描述”。
发布于 2017-07-11 13:57:44
添加"NSLocationAlwaysAndWhenInUseUsageDescription“,而不是”隐私-位置始终和在使用时使用描述“。在当前的测试版中,它不会被重命名为任何东西,但是它显示了iOS 11的正确对话框。
发布于 2019-06-06 11:39:03
您需要这样添加NSLocationAlwaysAndWhenInUseUsageDescription inInfo.plist
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>App_Name requires user’s location for better user experience.</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>App_Name requires user’s location for better user experience.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>App_Name requires user’s location for better user experience.</string>发布于 2017-08-15 22:20:25
请参阅authorization?language=objc
基本上,它要求您在应用程序的NSLocationWhenInUseUsageDescription文件中包含NSLocationWhenInUseUsageDescription和NSLocationAlwaysAndWhenInUsageDescription键。(如果您的应用程序支持iOS 10及更早版本,则还需要NSLocationAlwaysUsageDescription键。)如果这些密钥不存在,授权请求将立即失败。
我目前正在使用Xcode版本9.0beta 5 (9M202q),它的工作没有问题。
https://stackoverflow.com/questions/45033600
复制相似问题