本文介绍了Xcode8中的NSPhotoLibraryUsageDescription的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新 :
我尝试将字符串值添加到"NSPhotoLibraryUsageDescription"键.

Update:
I attempt to add a String value to the "NSPhotoLibraryUsageDescription" key.

它有效.我的构建版本现在可以在我的TestFlight上使用.

And it works.My build version is now available on my TestFlight.

ps:构建版本表示构建版本

但是我想知道为什么Apple Store只允许我为"NSPhotoLibraryUsageDescription"键而不是"Camera Usage Description""Location When In Use Usage Description"添加字符串值?以及如何本地化info.plist.


:
我已将许多构建版本上载到iTunes Connect.但是TestFlight没有显示这些构建版本.
然后,我在stackoverflow上搜索此问题.而且我知道这是由用法说明引起的.我在我的Info.plist中添加了 NSPhotoLibraryUsageDescription .但是,Apple Store团队通过电子邮件告诉我:

But I want to know why Apple Store just let me add String value for "NSPhotoLibraryUsageDescription" key rather than "Camera Usage Description" or "Location When In Use Usage Description"?And how to localize the info.plist.


Old:
I've uploaded many build versions to iTunes Connect.But TestFlight shows none of these build versions.
Then I search this issue on stackoverflow. And I know this is caused by usage description. I add the NSPhotoLibraryUsageDescription in my Info.plist.However, Apple Store team email and tell me that:

我们发现您最近交付的家庭健康追踪器"存在一个或多个问题.要处理您的交货,必须更正以下问题:

We have discovered one or more issues with your recent delivery for "Family Health Tracker". To process your delivery, the following issues must be corrected:

此应用尝试访问对隐私敏感的数据,而没有使用说明.该应用程序的Info.plist必须包含一个 NSPhotoLibraryUsageDescription 键,该键具有一个字符串值,向用户解释该应用程序如何使用此数据.

This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data.

这些问题一经纠正,您就可以重新交付已纠正的二进制文件.

Once these issues have been corrected, you can then redeliver the corrected binary.

此致

App Store团队

The App Store team

他们仍然告诉我添加 NSPhotoLibraryUsageDescription

推荐答案

info.plist文件的本地化可能非常无用,尤其是在您的应用程序中使用多种语言的情况下.本地化NSPhotoLibraryUsageDescriptionNSLocationWhenInUseUsageDescriptionNSCameraUsageDescription键的最简单方法是在InfoPlist.strings文件中对其进行描述.

Localizing of info.plist file may be very unuseful, especially if you use many languages in your apps.The simplest way for localizing NSPhotoLibraryUsageDescription, NSLocationWhenInUseUsageDescriptionor NSCameraUsageDescription keys is to describe it in InfoPlist.strings file.

  • 使用名称InfoPlist创建新的*.strings文件;
  • 在文件检查器中按Localize...按钮,然后选择默认语言;
  • 在新的InfoPlist.strings文件中添加新记录.例如英文:
  • Create new *.strings file with name InfoPlist;
  • Press Localize... button in file inspector and choose the default language;
  • Add new records in your new InfoPlist.strings file. For examplein English:

NSPhotoLibraryUsageDescription =照片使用说明";

NSPhotoLibraryUsageDescription = "Photos usage description";

NSCameraUsageDescription =摄像机使用说明";

NSCameraUsageDescription = "Camera usage description";

更多信息 Apple文档

这篇关于Xcode8中的NSPhotoLibraryUsageDescription的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!