• iOS10适配——相机,通讯录,麦克风等权限设置


      崩溃:[access] This app has crashed because it attempted 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.

      这个是拍照动作引起的崩溃,在升Xcode+iOS10之前都是好的,升级之后,需要在plist文件中添加相册权限。相应的麦克风,通讯录,如果项目中涉及到了,也需要添加相应的权限。报错的相应key值:

      通信录:NSContactsUsageDescription

      麦克风:NSMicrophoneUsageDescription

      相册:NSPhotoLibraryUsageDescription

      这里仅以相册的为例:

      plist文件里面添加,Privacy - Photo Library Usage Description,Value值为描述,弹出的提示框会显示出来。

        升到iOS10之后,需要设置权限的有:

    • 麦克风权限:Privacy - Microphone Usage Description 是否允许此App使用你的麦克风?
    • 相机权限: Privacy - Camera Usage Description 是否允许此App使用你的相机?
    • 相册权限: Privacy - Photo Library Usage Description 是否允许此App访问你的媒体资料库?
    • 通讯录权限: Privacy - Contacts Usage Description 是否允许此App访问你的通讯录?
    • 蓝牙权限:Privacy - Bluetooth Peripheral Usage Description 是否许允此App使用蓝牙?
    • 语音转文字权限:Privacy - Speech Recognition Usage Description 是否允许此App使用语音识别?
    • 日历权限:Privacy - Calendars Usage Description 
    • 定位权限:Privacy - Location When In Use Usage Description 
    • 定位权限: Privacy - Location Always Usage Description 
    • 位置权限:Privacy - Location Usage Description
    • 媒体库权限:Privacy - Media Library Usage Description
    • 健康分享权限:Privacy - Health Share Usage Description
    • 健康更新权限:Privacy - Health Update Usage Description
    • 运动使用权限:Privacy - Motion Usage Description
    • 音乐权限:Privacy - Music Usage Description
    • 提醒使用权限:Privacy - Reminders Usage Description
    • Siri使用权限:Privacy - Siri Usage Description
    • 电视供应商使用权限:Privacy - TV Provider Usage Description
    • 视频用户账号使用权限:Privacy - Video Subscriber Account Usage Description
  • 相关阅读:
    将10进制数字转成62进制数字(转)
    admin添加用户时报错:(1452, 'Cannot add or update a child row: a foreign key constraint fails (`mxonline`.`django_admin_l
    Django admin 中抛出 'WSGIRequest' object has no attribute 'user'的错误
    分布式爬虫
    Scrapy之CrawlSpider
    Scrapy之Cookie和代理
    Scrapy核心组件
    scrapy之持久化存储
    Scrapy框架的基本使用
    爬虫之request模块高级
  • 原文地址:https://www.cnblogs.com/yyt-hehe-yyt/p/5896640.html
Copyright © 2020-2023  润新知