出现这个问题是由于iOS对用户的安全和隐私的加强,在申请不少私有权限的时候都须要添加描述,可是,在使用Xcode 8以前的Xcode仍是使用系统的权限通知框.要想解决这个问题,只须要在info.plist添加NSContactsUsageDescription的key, value便可:安全
以下:code
<!-- 相册 --> <key>NSPhotoLibraryUsageDescription</key> <string>App须要您的赞成,才能访问相册</string> <!-- 相机 --> <key>NSCameraUsageDescription</key> <string>App须要您的赞成,才能访问相机</string> <!-- 麦克风 --> <key>NSMicrophoneUsageDescription</key> <string>App须要您的赞成,才能访问麦克风</string> <!-- 位置 --> <key>NSLocationUsageDescription</key> <string>App须要您的赞成,才能访问位置</string> <!-- 在使用期间访问位置 --> <key>NSLocationWhenInUseUsageDescription</key> <string>App须要您的赞成,才能在使用期间访问位置</string> <!-- 始终访问位置 --> <key>NSLocationAlwaysUsageDescription</key> <string>App须要您的赞成,才能始终访问位置</string> <!-- 日历 --> <key>NSCalendarsUsageDescription</key> <string>App须要您的赞成,才能访问日历</string> <!-- 提醒事项 --> <key>NSRemindersUsageDescription</key> <string>App须要您的赞成,才能访问提醒事项</string> <!-- 运动与健身 --> <key>NSMotionUsageDescription</key> <string>App须要您的赞成,才能访问运动与健身</string> <!-- 健康更新 --> <key>NSHealthUpdateUsageDescription</key> <string>App须要您的赞成,才能访问健康更新 </string> <!-- 健康分享 --> <key>NSHealthShareUsageDescription</key> <string>App须要您的赞成,才能访问健康分享</string> <!-- 蓝牙 --> <key>NSBluetoothPeripheralUsageDescription</key> <string>App须要您的赞成,才能访问蓝牙</string> <!-- 媒体资料库 --> <key>NSAppleMusicUsageDescription</key> <string>App须要您的赞成,才能访问媒体资料库</string>
若是不起做用,能够请求后台权限,相似于这样:
<key>UIBackgroundModes</key> <array> <!-- 在这里写上你在后台模式下要使用权限对应的key --> <string>location</string> ... </array>