【发布时间】:2017-01-31 18:47:10
【问题描述】:
操作系统:IOS 10 和 watchos3
我在开发最新应用时发现了一个问题。
我的应用需要请求照片库权限才能保存一些图像。 在手表应用和ios中,我在plist中添加了照片库访问权限。
我注意到,当手表应用在前台运行时,我在我的 ios 设备上按请求权限。
隐私 - 照片库使用说明
一旦ios权限请求成功,手表应用会崩溃,代码如下程序以exit code结束:0,这似乎是操作系统级别的行为我。
func requestPhotoLibraryPermission(){
PHPhotoLibrary.requestAuthorization { status in
switch status {
case .authorized:
break
default:
self.showErrorMessage(title: NSLocalizedString("Permission Denied", comment: "Permission Denied"), message: NSLocalizedString("You can enable Photo Library permission from the settings app", comment: "You can enable Photo Library permission from the settings app") ,completionBlock: {
})
// place for .NotDetermined - in this callback status is already determined so should never get here
break
}
}
}
如您所见,代码非常简单。有人遇到过类似的问题吗?有什么已知的解决方法吗?
【问题讨论】:
-
与麦克风权限相同的问题。
-
Apple Music 存在同样问题
标签: ios debugging crash ios10 watchos-3