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

It’s NSPhotoLibraryAddUsageDescription #24

Merged
merged 1 commit into from
Jan 7, 2018

Conversation

gerrior
Copy link
Contributor

@gerrior gerrior commented Nov 22, 2017

Running "Chapter 13" on Xcode Version 9.1 (9B55) for iOS 11 and clicking the Save button results in "[access] This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryAddUsageDescription key with a string value explaining to the user how the app uses this data."

In the Simulator be sure to select Hardware > "Erase All Content and Settings..." to see this behavior. Once access has been granted - this issue won't reappear.

In Info.plist, change NSPhotoLibraryUsageDescription to NSPhotoLibraryAddUsageDescription (The word Add is in there). "Include the NSPhotoLibraryAddUsageDescription key (in apps that link on or after iOS 11)" More information here

Running "Chapter 13" on Xcode Version 9.1 (9B55) for iOS 11 and clicking the save button results in "[access] This app has crashed because it attempted to access privacy-sensitive data without a usage description.  The app's Info.plist must contain an NSPhotoLibraryAddUsageDescription key with a string value explaining to the user how the app uses this data."

In the Simulator be sure to select Hardware > "Erase All Content and Settings..." to see this behavior. Once access has been granted - this issue won't reappear.

In Info.plist, change NSPhotoLibraryUsageDescription to NSPhotoLibraryAddUsageDescription (The word Add is in there). "Include the NSPhotoLibraryAddUsageDescription key (in apps that link on or after iOS 11)" More information here: https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW73
@gerrior
Copy link
Contributor Author

gerrior commented Nov 23, 2017

Some more detail regarding the Apple documentation link. NSPhotoLibraryUsageDescription isn't needed under iOS 11 (or at least for UIImagePickerController). Removing this key (and reseting the simulator) and you can import an image without issue. So I'm confused about this in the documentation "Although this keys governs read and write access to the user’s photo library " - clearly that isn't the case here.

Save requires NSPhotoLibraryAddUsageDescription.

@twostraws twostraws merged commit db581a1 into twostraws:master Jan 7, 2018
@twostraws
Copy link
Owner

Thanks, Mark!

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

3 participants