Skip to content
This repository has been archived by the owner on Jun 2, 2018. It is now read-only.

ITC complains about missing NSPhotoLibraryUsageDescription key because of UIImagePickerController category #365

Open
dtrofimov opened this issue Jul 6, 2017 · 1 comment

Comments

@dtrofimov
Copy link

I'm trying to submit my build to iTunes Connect. I'm using BlocksKit 2.2.5, including BlocksKit+UIKit. This contains UIImagePickerController+BlocksKit, which I'm not actually using, and that category causes a submission issue:

Missing Info.plist key - This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data.

As specified in Technical Q&A QA1937, NSPhotoLibraryUsageDescription key is required when using the following libraries:

UIImagePickerController or PHPhotoLibrary requestAuthorization: used in conjunction with any of the following classes: PHAsset PHAssetCollection PHCollection PHCollectionList

I can think out the following options.

  • Forking BlocksKit and removing UIImagePickerController+BlocksKit category.
  • Using post_install hook to remove the specific files and the corresponding #import link (I'm not sure if that's possible).
  • Waiting for someone to fix this issue in the original BlocksKit library and to separate UIImagePickerController+BlocksKit category to a different podspec.

I'm using:

  • Xcode 8.2.1 (8C1002);
  • building for iOS 9.0+;
  • CocoaPods 1.2.1;
  • BlocksKit 2.2.5 (Core and UIKit subspecs).
@dtrofimov
Copy link
Author

I managed to remove the category from compile sources phase with the following code in Podfile:

post_install do |installer|
  target = installer.pods_project.native_targets.detect do |target|
    target.name == "BlocksKit-Core-DynamicDelegate-UIKit"
  end
  build_phase = target.source_build_phase
  build_file = build_phase.files.detect do |file|
    file.display_name == "UIImagePickerController+BlocksKit.m"
  end
  build_phase.remove_build_file(build_file)
end

After that, the build was submitted to ITC successfully.

However, it would be great if BlocksKit is updated to handle this situation out of the box. Probably, by moving the categories requiring special settings to separate subspecs.

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

No branches or pull requests

1 participant