yeahdongcn / RSBarcodes_Swift

1D and 2D barcodes reader and generators for iOS 8 with delightful controls. Now Swift.
MIT License
709 stars 185 forks source link

Pod is causing App Store rejection #88

Open bdrelling opened 7 years ago

bdrelling commented 7 years ago

At some point, the sample was included in the pod directories, causing our app to get rejected when submitting to the app store with these two messages:

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.

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

Using this link, I looked up references to the mentioned API Requiring Usage Description: https://developer.apple.com/library/content/qa/qa1937/_index.html

The only instance of AVCaptureDeviceInput is in the RSCodeReaderViewController.swift within RSBarcodesSample.

RSCodeReaderViewController.swift:123-129

 let input: AVCaptureDeviceInput!
 do {
     input = try AVCaptureDeviceInput(device: self.device)
 } catch let error1 as NSError {
     error = error1
     input = nil
 }

Your pod shouldn't be doing something like this without having it as an optional subspec. Also, anything from a Sample project shouldn't be included in the podspec.

yeahdongcn commented 7 years ago

Yes, you have to add NSPhotoLibraryUsageDescription and NSCameraUsageDescription to your app's info.plist if you integrate RSBarcodes_Swift in your app.

bdrelling commented 7 years ago

Any logic trying to do this should just be added as an optional subspec to the pod. This isn't something that should be forced on someone just consuming the pod.