NSPhotoLibraryAddUsageDescription解决办法

图片并保存到本地的功能,一点发现闪退了。发现 Xcode 报以下错误:

The app's Info.plist must contain an NSPhotoLibraryAddUsageDescription key with a string value explaining to the user how the app uses this data.

解决方案

Info.plist 里面要涉及隐私数据时要添加一句“提示语”。打开 Info.plist  点击 + 号,在 Key 中输入:Privacy - Photo Library Additions Usage Description,Type 选择 String,Value 中输入你保存图片的用途提示语。
下面是项目用到的所有Info.plist中权限 以及提示语  上架的时候如果你没有说明访问相册的用途会 审核不通过 审核不通过 审核不通过  其他的权限一样要写明用途
<key>NSAppleMusicUsageDescription</key>
    <string>App需要您的同意,才能访问媒体资料库</string>
    <key>NSBluetoothPeripheralUsageDescription</key>
    <string>App需要您的同意,才能访问蓝牙</string>
    <key>NSCalendarsUsageDescription</key>
    <string>App需要您的同意,才能访问日历</string>
    <key>NSCameraUsageDescription</key>
    <string>App需要您的同意,才能访问相机上传评价图片</string>
    <key>NSContactsUsageDescription</key>
    <string>contactsDesciption</string>
    <key>NSHealthShareUsageDescription</key>
    <string>App需要您的同意,才能访问健康分享</string>
    <key>NSHealthUpdateUsageDescription</key>
    <string>App需要您的同意,才能访问健康更新 </string>
    <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
    <string>我们需要通过您的地理位置信息获取您周边的相关店铺数据</string>
    <key>NSLocationAlwaysUsageDescription</key>
    <string>App需要您的同意,才能始终访问位置用于定位您的城市名</string>
    <key>NSLocationUsageDescription</key>
    <string>App需要您的同意,才能访问位置用于定位您的城市名</string>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string>App需要您的同意,用于显示所在城市名称</string>
    <key>NSMicrophoneUsageDescription</key>
    <string>App需要您的同意,才能访问麦克风用于语音收索服务</string>
    <key>NSMotionUsageDescription</key>
    <string>App需要您的同意,才能访问运动与健身</string>
    <key>NSPhotoLibraryUsageDescription</key>
    <string>App需要您的同意,才能访问相册用于上传评价图片</string>
    <key>NSPhotoLibraryAddUsageDescription</key>
    <string>App需要您的同意,用于保存图片到手机</string>
    <key>NSRemindersUsageDescription</key>
    <string>App需要您的同意,才能访问提醒事项</string>
    <key>UIRequiredDeviceCapabilities</key>

猜你喜欢

转载自www.cnblogs.com/dujiahong/p/9583077.html
今日推荐