iOS 10.0 运行时崩溃中的 NSCameraUsageDescription? [英] NSCameraUsageDescription in iOS 10.0 runtime crash?

查看:26
本文介绍了iOS 10.0 运行时崩溃中的 NSCameraUsageDescription?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 iOS 10.0 最后一个测试版.我曾尝试使用相机扫描我的应用程序中的条形码,但它因运行时错误而崩溃.

Using iOS 10.0 last beta. I had tried to use Camera to scan barcode in my app, and it crashed with this runtime error.

此应用已崩溃,因为它试图访问隐私敏感信息没有使用说明的数据.应用的 Info.plist 必须包含一个带有字符串值的 NSCameraUsageDescription 键,用于解释用户应用如何使用这些数据.

This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.

把这个key放入plist,还是crash?

Put this key into the plist, but it still crashed?

推荐答案

在 iOS 10 之后,您必须在 Info.plist 中定义并提供应用程序访问的所有系统隐私敏感数据的使用说明,如下所示:

After iOS 10 you have to define and provide a usage description of all the system’s privacy-sensitive data accessed by your app in Info.plist as below:

日历

Key    :  Privacy - Calendars Usage Description    
Value  :  $(PRODUCT_NAME) calendar events

提醒:

Key    :   Privacy - Reminders Usage Description    
Value  :   $(PRODUCT_NAME) reminder use

联系方式:

Key    :   Privacy - Contacts Usage Description     
Value  :  $(PRODUCT_NAME) contact use

照片:

Key    :  Privacy - Photo Library Usage Description    
Value  :  $(PRODUCT_NAME) photo use

蓝牙共享:

Key    :  Privacy - Bluetooth Peripheral Usage Description     
Value  :  $(PRODUCT_NAME) Bluetooth Peripheral use

麦克风:

Key    :  Privacy - Microphone Usage Description    
Value  :  $(PRODUCT_NAME) microphone use

相机:

Key    :  Privacy - Camera Usage Description   
Value  :  $(PRODUCT_NAME) camera use

位置:

Key    :  Privacy - Location Always Usage Description   
Value  :  $(PRODUCT_NAME) location use

Key    :  Privacy - Location When In Use Usage Description   
Value  :  $(PRODUCT_NAME) location use

希思:

Key    :  Privacy - Health Share Usage Description   
Value  :  $(PRODUCT_NAME) heath share use

Key    :  Privacy - Health Update Usage Description   
Value  :  $(PRODUCT_NAME) heath update use

家庭套件:

Key    :  Privacy - HomeKit Usage Description   
Value  :  $(PRODUCT_NAME) home kit use

媒体库:

Key    :  Privacy - Media Library Usage Description   
Value  :  $(PRODUCT_NAME) media library use

运动:

Key    :  Privacy - Motion Usage Description   
Value  :  $(PRODUCT_NAME) motion use

语音识别:

Key    :  Privacy - Speech Recognition Usage Description   
Value  :  $(PRODUCT_NAME) speech use

SiriKit:

Key    :  Privacy - Siri Usage Description  
Value  :  $(PRODUCT_NAME) siri use

电视提供商:

Key    :  Privacy - TV Provider Usage Description   
Value  :  $(PRODUCT_NAME) tvProvider use

您可以在这个 链接.

这篇关于iOS 10.0 运行时崩溃中的 NSCameraUsageDescription?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆