Buglife / Buglife-iOS

Awesome bug reporting for iOS apps
Apache License 2.0
509 stars 63 forks source link

Current framework requires extra app permission with XCode 8 #15

Closed richardgroves closed 8 years ago

richardgroves commented 8 years ago

The current build of the framework installed via cocoapods (version 1.3.0) will trigger an 'Invalid binary' rejection from Apple when an app is submitted to the app store after building with XCode 8.

Exact rejection text is:

"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."

It seems at about the GM time of the latest XCode cycle they fired up a new static analyser that is even more aggressive about code that even looks like it touches the camera or photo library (Other libraries are triggering various other warnings too - http://stackoverflow.com/questions/39383289/ios-10-gm-release-error-when-submitting-apps-this-app-attempts-to-access-privac)

schukin commented 8 years ago

Thanks for the notice! And that's unfortunate; The Buglife SDK can leverage the user's photo library to add photo attachments, however we do check at runtime for the presence of an NSPhotoLibraryUsageDescription key before surfacing this option. Apparently this is insufficient.

We can suggest the following workaround (as discussed in the thread you linked to): Add the NSPhotoLibraryUsageDescription key to your app's Info.plist, along with a string value such as "To attach a photo to bug reports, we need to access your photo library."

We'll work on an update to the Buglife SDK that reduces the possibility of getting App Store rejections for this reason, as well as of course updating our documentation. Thanks again & apologies for the inconvenience!

richardgroves commented 8 years ago

It's a pain they are being so over-sensitive, but this is Apple...

I found the BugLife issue when I was trying to work out a problem with one of my own frameworks and was just removing other things to see if the problems were in my framework or elsewhere.

Updating your documentation should be enough so that no-one gets surprised - doubt there will be a way to keep the photo attachment feature and escape the Apple detection.

[Updated] OK - so once the string is in there the 'Attach Photo' option is always going to come up now because of your detection logic in the current version?

schukin commented 8 years ago

(Apologies for the late response, GitHub apparently doesn't send notifications for comment edits.) Yes, the 'Attach Photo' option is intentionally always there. Is this something you'd like to hide / disable?

richardgroves commented 8 years ago

Not a problem to have it always there. Just that it will trigger the 'Allow access to photos' if the main app hasn't already triggered that. I guess you could check the authorisation status of the photo library before showing the option to avoid that, but it wont stop having to have the PList string.

schukin commented 8 years ago

The "Attach Photo" option is only present if both (1) the required key is in the app's Info.plist, and (2) the user has already granted permissions for camera roll access. Buglife will not request permissions on its own.

We've updated the docs accordingly. Thanks @richardgroves!