BlocksKit / BlocksKit

The Objective-C block utilities you always wish you had.
MIT License
6.89k stars 1.26k forks source link

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

Open dtrofimov opened 7 years ago

dtrofimov commented 7 years ago

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.

I'm using:

dtrofimov commented 7 years ago

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.