ios 应用程序因缺少使用说明而被拒绝 (Xcode8)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/39415895/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
App rejected due to missing usage descriptions (Xcode8)
提问by KimHafr
So I got this mail today saying that the latest build of my app was rejected by iTunes Connect due to some missing usage descriptions. To be exact:
所以我今天收到这封邮件,说我的应用程序的最新版本由于缺少一些使用说明而被 iTunes Connect 拒绝。确切地说:
This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSContactsUsageDescription key with a string value explaining to the user how the app uses this data.
This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCalendarsUsageDescription key with a string value explaining to the user how the app uses this data.
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.
This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSBluetoothPeripheralUsageDescription key with a string value explaining to the user how the app uses this data.
This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSMicrophoneUsageDescription key with a string value explaining to the user how the app uses this data.
This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSMotionUsageDescription 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.
此应用程序尝试在没有使用说明的情况下访问隐私敏感数据。应用程序的 Info.plist 必须包含一个 NSContactsUsageDescription 键和一个字符串值,向用户解释应用程序如何使用这些数据。
此应用程序尝试在没有使用说明的情况下访问隐私敏感数据。应用程序的 Info.plist 必须包含一个 NSCalendarsUsageDescription 键和一个字符串值,向用户解释应用程序如何使用这些数据。
此应用程序尝试在没有使用说明的情况下访问隐私敏感数据。应用程序的 Info.plist 必须包含一个 NSPhotoLibraryUsageDescription 键和一个字符串值,向用户解释应用程序如何使用这些数据。
此应用程序尝试在没有使用说明的情况下访问隐私敏感数据。应用程序的 Info.plist 必须包含一个 NSBluetoothPeripheralUsageDescription 键和一个字符串值,向用户解释应用程序如何使用这些数据。
此应用程序尝试在没有使用说明的情况下访问隐私敏感数据。应用程序的 Info.plist 必须包含一个 NSMicrophoneUsageDescription 键和一个字符串值,向用户解释应用程序如何使用这些数据。
此应用程序尝试在没有使用说明的情况下访问隐私敏感数据。应用程序的 Info.plist 必须包含一个 NSMotionUsageDescription 键和一个字符串值,向用户解释应用程序如何使用这些数据。
更正这些问题后,您就可以重新交付更正后的二进制文件。
I figured out that these have become mandatory with iOS 10, but the only problem is that my app is not requesting permission to access any of these.. I thought the description only was mandatory if you actually requested a permission?
我发现这些在 iOS 10 中已经成为强制性的,但唯一的问题是我的应用程序没有请求访问其中任何一个的权限。
Is it because one of my dependencies (Cocoapods) might contain some code to request these permissions? Or are these descriptions mandatory even if I never request to see the users calendar, contacts, etc?
是不是因为我的一个依赖项(Cocoapods)可能包含一些请求这些权限的代码?或者即使我从不要求查看用户日历、联系人等,这些描述是否也是强制性的?
采纳答案by Matthew Seaman
The descriptions are mandatory for any content you or any frameworks you link against attempt to access. The errors are generated upon an attempt to access the content if a usage description was not supplied, so if you're getting those errors your app must be requesting them. You should discover why your app or its frameworks require these and add appropriate usage descriptions to your app's info.plist.
对于您或您链接的任何框架尝试访问的任何内容,这些描述都是强制性的。如果未提供使用说明,则会在尝试访问内容时生成错误,因此如果您收到这些错误,您的应用程序必须请求它们。您应该了解为什么您的应用或其框架需要这些,并在应用的 info.plist 中添加适当的使用说明。
Or more ideally, if you don't need access, see if there's a way to not request it (or use frameworks that do unnecessarily).
或者更理想的是,如果您不需要访问权限,请查看是否有办法不请求它(或使用不必要的框架)。
回答by Mitul Marsoniya
iOS 10must add permission in info.plistjust review this BLOG :- settings-in-ios-10you get all idea.
iOS 10必须在info.plist 中添加权限,只需查看此BLOG:- settings-in-ios-10您就明白了。
Add permissionin info.plistfile base on your errorlog.
根据您的错误日志在info.plist文件中添加权限。
Note:Write proper reason for permission in string value otherwise apple reject app again.
注意:在字符串值中写入正确的许可原因,否则苹果再次拒绝应用程序。
NSCameraUsageDescription
NSCameraUsageDescription
<key>NSCameraUsageDescription</key>
<string>You have to describe the real usage for a human.</string>
NSContactsUsageDescription
NSContactsUsageDescription
<key>NSContactsUsageDescription</key>
<string>You have to describe the real usage for a human.</string>
NSPhotoLibraryUsageDescription
NSPhotoLibraryUsageDescription
<key>NSPhotoLibraryUsageDescription</key>
<string>You have to describe the real usage for a human.</string>
NSBluetoothPeripheralUsageDescription
NSBluetoothPeripheralUsageDescription
<key>NSBluetoothPeripheralUsageDescription</key>
<string>You have to describe the real usage for a human.</string>
NSMicrophoneUsageDescription
NSMicrophoneUsageDescription
<key>NSMicrophoneUsageDescription</key>
<string>You have to describe the real usage for a human.</string>
NSMotionUsageDescription
NSMotionUsageDescription
<key>NSMotionUsageDescription</key>
<string>$(PRODUCT_NAME) motion use.</string>
NSLocationAlwaysUsageDescription
NSLocationAlwaysUsageDescription
<key>NSLocationAlwaysUsageDescription</key>
<string>You have to describe the real usage for a human.</string>
NSLocationUsageDescription
NSLocationUsageDescription
<key>NSLocationUsageDescription</key>
<string>You have to describe the real usage for a human.</string>
NSLocationWhenInUseUsageDescription
NSLocationWhenInUseUsageDescription
<key>NSLocationWhenInUseUsageDescription</key>
<string>You have to describe the real usage for a human.</string>
NSRemindersUsageDescription
NSRemindersUsageDescription
<key>NSRemindersUsageDescription</key>
<string>You have to describe the real usage for a human.</string>
NSSiriUsageDescription
NSSiriUsageDescription
<key>NSSiriUsageDescription</key>
<string>You have to describe the real usage for a human.</string>
NSVideoSubscriberAccountUsageDescription
NSVideoSubscriberAccountUsageDescription
<key>NSVideoSubscriberAccountUsageDescription</key>
<string>You have to describe the real usage for a human.</string>
NSSpeechRecognitionUsageDescription
NSSpeechRecognitionUsageDescription
<key>NSSpeechRecognitionUsageDescription</key>
<string>You have to describe the real usage for a human.</string>
NSCalendarsUsageDescription
NSCalendarsUsageDescription
<key>NSCalendarsUsageDescription</key>
<string>You have to describe the real usage for a human.</string>
回答by mgyky
You can add in your info.plist like :
您可以在 info.plist 中添加如下内容:
<key>NSCalendarsUsageDescription</key>
<string>Explain the reasons for accessing...</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Explain the reasons for accessing...</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>Explain the reasons for accessing...</string>
etc.
等等。
Hope will help someone...
希望能帮助某人...
回答by Dielson Sales
I had the same issue, and it appears that if any framework you link against has code that asks this permission(even if your app never requests them), the usage descriptions are necessary. But according to my test, if you don't request them, they won't appear in the permissions list of your app.
我遇到了同样的问题,似乎如果您链接的任何框架都有请求此权限的代码(即使您的应用程序从未请求它们),则需要使用说明。但是根据我的测试,如果您不请求它们,它们将不会出现在您的应用程序的权限列表中。
回答by Trinadh Koya
Calendar :Key : Privacy - Calendars Usage Description
Value : $(PRODUCT_NAME) calendar events
Calendar :Key : Privacy - Calendars Usage Description
Value : $(PRODUCT_NAME) 日历事件
Reminder :Key : Privacy - Reminders Usage Description
Value : $(PRODUCT_NAME) reminder use
Reminder :Key : Privacy - Reminders Usage Description
Value : $(PRODUCT_NAME) 提醒使用
Contact:
Key : Privacy - Contacts Usage Description
Value : $(PRODUCT_NAME) contact use
Contact: Key : Privacy - Contacts Usage Description
Value : $(PRODUCT_NAME) contact use
Photo :Key : Privacy - Photo Library Usage Description
Value : $(PRODUCT_NAME) photo use
照片:键:隐私 - 照片库使用说明
值:$(PRODUCT_NAME) 照片使用
Bluetooth Sharing :Key : Privacy - Bluetooth Peripheral Usage Description
Value : $(PRODUCT_NAME) Bluetooth Peripheral use
蓝牙共享:密钥:隐私 - 蓝牙外设使用说明
值:$(PRODUCT_NAME) 蓝牙外设使用
Microphone :Key : Privacy - Microphone Usage Description
Value : $(PRODUCT_NAME) microphone use
麦克风:键:隐私 - 麦克风使用说明
值:$(PRODUCT_NAME) 麦克风使用
Camera :Key : Privacy - Camera Usage Description
Value : $(PRODUCT_NAME) camera use
相机:键:隐私 - 相机使用说明
值:$(PRODUCT_NAME) 相机使用
Location :Key : Privacy - Location Always Usage Description
Value : $(PRODUCT_NAME) location use
位置:键:隐私 - 位置始终使用说明
值:$(PRODUCT_NAME) 位置使用
Key : Privacy - Location When In Use Usage Description
Value : $(PRODUCT_NAME) location use
键:隐私 - 使用时的位置使用说明
值:$(PRODUCT_NAME) 位置使用
Heath :Key : Privacy - Health Share Usage Description
Value : $(PRODUCT_NAME) heath share use
健康:键:隐私 - 健康共享使用说明
值:$(PRODUCT_NAME) 健康共享使用
Key : Privacy - Health Update Usage Description
Value : $(PRODUCT_NAME) heath update use
键:隐私 - 健康更新使用说明
值:$(PRODUCT_NAME) 健康更新使用
HomeKit :Key : Privacy - HomeKit Usage Description
Value : $(PRODUCT_NAME) home kit use
HomeKit :Key : Privacy - HomeKit Usage Description
Value : $(PRODUCT_NAME) home kit use
Media Library :Key : Privacy - Media Library Usage Description
Value : $(PRODUCT_NAME) media library use
媒体库:键:隐私 - 媒体库使用说明
值:$(PRODUCT_NAME) 媒体库使用
Motion :Key : Privacy - Motion Usage Description
Value : $(PRODUCT_NAME) motion use
Motion :Key : Privacy - Motion Usage Description
Value : $(PRODUCT_NAME) Motion use
Speech Recognition :Key : Privacy - Speech Recognition Usage Description
Value : $(PRODUCT_NAME) speech use
Speech Recognition :Key : Privacy - Speech Recognition Usage Description
Value : $(PRODUCT_NAME) 语音使用
SiriKit :Key : Privacy - Siri Usage Description
Value : $(PRODUCT_NAME) siri use
SiriKit :Key : Privacy - Siri Usage Description
Value : $(PRODUCT_NAME) siri use
TV Provider :Key : Privacy - TV Provider Usage Description
Value : $(PRODUCT_NAME) tvProvider use
TV Provider :Key : Privacy - TV Provider Usage Description
Value : $(PRODUCT_NAME) tvProvider use
回答by rolinger
For anyone wondering why all of a sudden your app now has all these permission settings in the first place it could be because of CocoaPods or Carthage - they put in hooks to all of these permissions. I just upgraded my app to use cordova-plugin-firebasex which has an extensive Cocoapods (and dependencies) installation. You can turn these permissions off BEFORE you install cocoapods into your project by putting a PermissionsConfiguration.xcconfig in the root of your project - you can read more about this here: https://cocoapods.org/pods/Permission#installation
对于任何想知道为什么您的应用程序现在突然拥有所有这些权限设置的人来说,首先可能是因为 CocoaPods 或 Carthage - 他们为所有这些权限设置了钩子。我刚刚升级了我的应用程序以使用cordova-plugin-firebasex,它具有广泛的Cocoapods(和依赖项)安装。您可以在将 cocoapods 安装到项目之前关闭这些权限,方法是将 PermissionsConfiguration.xcconfig 放在项目的根目录中 - 您可以在此处阅读更多相关信息:https: //cocoapods.org/pods/Permission#installation
This all surprised me when the new version of my app was rejected with 7 permissions key/string missing from Info.plist file. I then had to dig into my project to find what was causing this since my app doesn't need or use any of these permissions (never has).
当我的应用程序的新版本因 Info.plist 文件中缺少 7 个权限键/字符串而被拒绝时,这一切都让我感到惊讶。然后我不得不深入我的项目以找出导致此问题的原因,因为我的应用程序不需要或使用任何这些权限(从来没有)。
It may exist but at the moment I can't find a way to remove permissions after pods integration...going to have to dig around on how to do this without starting my project over.
它可能存在,但目前我找不到在 pods 集成后删除权限的方法……我不得不在不重新开始我的项目的情况下研究如何做到这一点。