From c402b42d4a482387620b2ac1d426afd1902e7132 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=81=ACC=E7=81=ACC=E7=81=AC?= Date: Wed, 26 Aug 2020 11:03:12 +0800 Subject: [PATCH] show error to user whe Photos access denied --- Sources/CameraManager.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/CameraManager.swift b/Sources/CameraManager.swift index a568cea..9c540b5 100644 --- a/Sources/CameraManager.swift +++ b/Sources/CameraManager.swift @@ -570,6 +570,8 @@ open class CameraManager: NSObject, AVCaptureFileOutputRecordingDelegate, UIGest PHPhotoLibrary.requestAuthorization { status in if status == PHAuthorizationStatus.authorized { self._saveImageToLibrary(atFileURL: filePath, imageCompletion) + } else { + self._show(NSLocalizedString("Photos access denied", comment: ""), message: NSLocalizedString("Please allow \(Bundle.main.infoDictionary?[String(kCFBundleNameKey)] ?? "App") to access your photos in \"Settings -> Privacy -> Photos\"", comment: "")) } } } else { @@ -898,6 +900,8 @@ open class CameraManager: NSObject, AVCaptureFileOutputRecordingDelegate, UIGest PHPhotoLibrary.requestAuthorization { autorizationStatus in if autorizationStatus == .authorized { self._saveVideoToLibrary(outputFileURL) + } else { + self._show(NSLocalizedString("Photos access denied", comment: ""), message: NSLocalizedString("Please allow \(Bundle.main.infoDictionary?[String(kCFBundleNameKey)] ?? "App") to access your photos in \"Settings -> Privacy -> Photos\"", comment: "")) } } }