Skip to content

show error to user when Photos access denied#235

Open
fabcz wants to merge 1 commit intoimaginary-cloud:masterfrom
fabcz:master
Open

show error to user when Photos access denied#235
fabcz wants to merge 1 commit intoimaginary-cloud:masterfrom
fabcz:master

Conversation

@fabcz
Copy link

@fabcz fabcz commented Aug 26, 2020

No description provided.

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))

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.

2 participants