[英]Application crashing on iOS 11 due to privacy-sensitive data
My app was working smoothly in iOS 10 but not as i updated the application to iOS 11, application started to crash.我的应用程序在 iOS 10 中运行顺利,但当我将应用程序更新到 iOS 11 时,应用程序开始崩溃。 And I am getting following error:
我收到以下错误:
This app has crashed because it attempted 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.
As your error is suggesting just add由于您的错误提示只需添加
"Privacy - Contacts Usage Description"
into your info.plist.进入你的 info.plist。 It will be of String type so add whatever popup message you want to show to the user asking for accessing his/her contact list.
它将是字符串类型,因此添加您想要向用户显示的任何弹出消息,要求访问他/她的联系人列表。 Eg.
例如。 you may write "Application wants to access your contacts list."
您可以写“应用程序想要访问您的联系人列表”。
Key will be "Privacy - Contacts Usage Description"
and
Value will be "Application wants to access your contacts list."
It is due to because you are trying to access sensitive data without seeking permission.这是因为您试图在未经许可的情况下访问敏感数据。 To avoid this, you need to add a entry in your info.plist file in your all targets.
为避免这种情况,您需要在所有目标的 info.plist 文件中添加一个条目。 And specify the valid reason to access sensitive data.
并指定访问敏感数据的正当理由。
Thanks谢谢
You must declare access to any user private data types.您必须声明对任何用户私有数据类型的访问权限。 You do this by adding a usage key to your app's Info.plist together with a purpose string.
您可以通过向应用程序的 Info.plist 添加一个使用密钥和一个目的字符串来实现这一点。
<key>NSPhotoLibraryUsageDescription</key>
<string>$(PRODUCT_NAME) photo use</string>
<key>NSCameraUsageDescription</key>
<string>$(PRODUCT_NAME) camera use</string>
<key>NSMicrophoneUsageDescription</key>
<string>$(PRODUCT_NAME) microphone use</string>
<key>NSLocationUsageDescription</key>
<string>$(PRODUCT_NAME) location use</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>$(PRODUCT_NAME) location use</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>$(PRODUCT_NAME) always uses location </string>
<key>NSCalendarsUsageDescription</key>
<string>$(PRODUCT_NAME) calendar events</string>
<key>NSRemindersUsageDescription</key>
<string>$(PRODUCT_NAME) reminder use</string>
<key>NSContactsUsageDescription</key>
<string>$(PRODUCT_NAME) contact use</string>
<key>NSMotionUsageDescription</key>
<string>$(PRODUCT_NAME) motion use</string>
<key>NSHealthUpdateUsageDescription</key>
<string>$(PRODUCT_NAME) heath update use</string>
<key>NSHealthShareUsageDescription</key>
<string>$(PRODUCT_NAME) heath share use</string>
<key>NSBluetoothPeripheralUsageDescription</key>
<string>$(PRODUCT_NAME) Bluetooth Peripheral use</string>
<key>NSAppleMusicUsageDescription</key>
<string>$(PRODUCT_NAME) media library use</string>
<key>NSSiriUsageDescription</key>
<string>$(PRODUCT_NAME) siri use</string>
<key>NSHomeKitUsageDescription</key>
<string>$(PRODUCT_NAME) home kit use</string>
<key>NSSpeechRecognitionUsageDescription</key>
<string>$(PRODUCT_NAME) speech use</string>
<key>NSVideoSubscriberAccountUsageDescription</key>
<string>$(PRODUCT_NAME) tvProvider use</string>
You can read all the Privacy descriptions here .您可以在此处阅读所有隐私说明。
<key>NSContactsUsageDescription</key>
<string>Required to show list of contacts</string>
just write this into your info.plist file.只需将其写入您的info.plist文件即可。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.