Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show error to user when Photos access denied #235

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fabcz
Copy link

@fabcz fabcz commented Aug 26, 2020

No description provided.

@@ -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: ""))
Copy link

@NikKovIos NikKovIos Sep 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

                        let error = NSError(domain: "", code: 0, userInfo: [NSLocalizedDescriptionKey: "Photos access denied"])
                        imageCompletion(.failure(error))

@@ -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: ""))
Copy link

@NikKovIos NikKovIos Sep 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

                        let error = NSError(domain: "", code: 0, userInfo: [NSLocalizedDescriptionKey: "Photos access denied"])
                        self?._executeVideoCompletionWithURL(outputFileURL, error: error as NSError?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants