App is not asking for Photo Library usage permission - ios

I have added Privacy - Photo Library Additions Usage Description & Privacy - Photo Library Usage Description.
But none of the keys is asking for user permission to access the photo library.
I have tested in Simulator as well as in real device.
I even tried by adding a single key at a time. Like only Privacy - Photo Library Additions Usage Description or Privacy - Photo Library Usage Description. And also tried by adding both the keys together.
But none of the above scenarios is working for me.
I also added Privacy - Camera Usage Description and that's working perfectly fine. But photo library usage is not asking for user's permission
Any help is appreciated!

Note from Apple:
When using the UIImagePickerController to bring up the user's photo library, your > app doesn't need to request permission explicitly.
After iOS 10, if your app is using PHAsset, PHPhotoLibrary, and PHImageManager, then you need to include NSPhotoLibraryUsageDescription in app's Info.plist file.
Detail info is available here: apple-ref-documentation

Related

TCC __TCCAccessRequest_block_invoke

I'm getting this error frequently in Crashlytics.
TCC __TCCAccessRequest_block_invoke_2.80 + 222
TCC __CRASHING_DUE_TO_PRIVACY_VIOLATION__ + 682
In my app i'm downloading images and stored that images in photo gallery directly, i'm not creating suppurate folder to store these images. For this in plist i added access permission.
Privacy - Photo Library Additions Usage Description - Save downloaded photos in gallary
Privacy - Camera Usage Description - This app not access your Camera
Privacy - Microphone Usage Description - This app not access your Microphone
But i'm getting lot of crashes. See the below screen shot....
Can any one help me...
Ok this has been driving me nuts for the last couple of weeks. In my case I was missing: NSPhotoLibraryAddUsageDescription Which is apparently needed if the user tries to use the "save to camera roll" in the share controller. This appears to be new to iOS 11.
I already had this
NSPhotoLibraryUsageDescription
Which I used when user wanted to import. This gives me read/write permissions. However if the user went to export and used share controller prior to importing it would crash the app if NSPhotoLibraryAddUsageDescription wasn't in the plist. Hopefully this helps you and if not someone else.
Do you really need to save the photos?
If yes, the above answer works.
But if you have an app like mine which should NOT ALLOW user to save photos and the app still is crashing, then
Check all of your WKWebView that is are loading images.
If you long press on Webview it shows an option to save photos in app.
Fix for the crash:
webView?.allowsLinkPreview = false

Is it mandatory to add NSPhotoLibraryUsageDescription in info.plist?

I am not using UIImagePicker in my app and not accessing the Photo Library. I got a mail regarding add NSPhotoLibraryUsageDescription in info.plist file.
I have following questions
How to confirm my project accessing the photo library?
I already searched UIImagePicker in my project and did't get any result.
Is it mandatory to add NSPhotoLibraryUsageDescription in info.plist while i am not accessing the photo library?
Can any one help to find it out .
Thanks
UIImagePicker
An image picker controller manages user interactions and delivers the results of those interactions to a delegate object. The role and appearance of an image picker controller depend on the source type you assign to it before you present it.
whenever you used UIImagePicker, you have to give permission for that particular application
There is a list of all Cocoa Keys that you can specify in your Info.plist file:
https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html
(Xcode target -> Info -> Custom iOS Target Properties)
iOS already required permissions to access microphone, camera, and media library earlier (iOS6, iOS7), but since iOS10 the apps will crash if you don't provide the description why you are asking for the permission.
UPDATE:
Summary of all privacy keys (with example description):
Useful Link
You only have to add this key-value pair to your info.plist if you are actually accessing the photos any way. If it's not added the app is going to crash.
Check if any of your added dependencies using UIImagePicker.
No it's not mandatory to add NSPhotoLibraryUsageDescription key in info.plist. If your App is not using accessing photo from library/gallery then you should remove it. But as "#Bence Pattogato" said if Your app accessing photo from library/gallery and there is no key added in info.plist then it will be crash.
For your information below are different keys that required to add info.plist if you accessing relevant features according to camera/photo library.
1) NSPhotoLibraryUsageDescription : This key lets you describe the reason your app accesses the user’s photo library. When the system prompts the user to allow access, this string is displayed as part of the alert.
2) NSCameraUsageDescription : describes the reason that the app (including an iMessage app) accesses the device’s camera. When the system prompts the user to allow access, this string is displayed as part of the alert.
3) NSPhotoLibraryAddUsageDescription : (New in iOS 11) This key lets you describe the reason your app seeks write-only access to the user’s photo library. When the system prompts the user to allow access, this string is displayed as part of the alert.
Above information get from this Appel official link.

Xcode: Missing Info.plist key for NSCameraUsageDescription

After adding GPUImage to my Xcode project, my app is getting denied for Missing an Info.plist key for NSCameraUsageDescription.
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.
I have added the key and description to my plist in several different ways and over 10 builds have all gotten the same denial error.
Here is my info.plist with the Camera Usage key at the bottom.
Any ideas on why I still get denied when I clearly have this defined in my plist?
You need to put a particular and proper description to use Camera in your application. One my application is denied due to improper description. So try with a proper description, maybe it will help you.
<key>Privacy - Camera Usage Description</key>
<string>APPNAME requires access to your phone’s camera.</string>
Ok it is an old one but i'd share my experience... nothing was working for me.
What i add to to was :
using Xcode to edit the plist.info. NOT in an external editor !!!!
DO NOT edit the text CREATE a new key using the + sign.
it will ask you to replace the previous (unless the previous one has been entered wrong... my case i think)
Try the both Camera and Library permission in Plist.
<key>NSCameraUsageDescription</key>
<string>Access camera</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Library</string>
I know this is an older post, but for me, it took an hour to discover that I was not editing the correct Info.plist file, but the one for UI Tests. Double-check which one you are editing, it can be the cause.
You should enter the purpose of using camera as the description. If it does not give the purpose app will get rejected.
you should add something like
Appname requires to access camera for taking profile picture or Appname requires to access camera for uploading product images
From the apple: Check this link.
To protect user privacy, an iOS app linked on or after iOS 10.0, and
that accesses the device’s camera, must statically declare the intent
to do so. Include the NSCameraUsageDescription key in your app’s
Info.plist file and provide a purpose string for this key. If your app
attempts to access the device’s camera without a corresponding purpose
string, your app exits.
I got the same error as OP. I don't know why though because I wasn't using anything related to the camera in my app. So I included this as the description and worked.
"AppName does not use the camera to capture to take a profile picture or upload profile photos."
GPUImage is for capturing image and video, i guess adding Microphone permission might solve the issue
<key>NSCameraUsageDescription</key>
<string>Need to access your camera to capture a picture and record a video.</string>
<key>NSMicrophoneUsageDescription</key>
<string>Need to access your microphone to record a video.</string>
try!
<key>NSCameraUsageDescription</key>
<string>Need to access your camera to capture a photo add and update profile picture.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Need to access your photo library to select a photo add and update profile picture</string>
I have the same problem even I add the privacy-Camera Usage Description in the info.plist. I try to clean and rebuild the project. Reopen the Xcode. Everything doesn't work until I add the privacy-Camera Usage Description in the Custom ios Target Properties. Hope it solve your problem.
For app store submission, The Usage description should briefly explain why we really needs that feature.
Description:
Camera Use
is too short and doesn't explains why we actually need camera.
It should be something like:
App Needs to use camera to take Profile picture
If you write
Privacy - Camera Usage Description,
change to
NSCameraUsageDescription
you have to put accurate condition in front of any policy, "camera use" is wrong
here, and for this specific problem you have to put "AVCaptureDeviceInput" in front of privacy. Hope it will work for you.
For more you can go to this link and check other privacy policy as well.
https://developer.apple.com/library/content/qa/qa1937/_index.html
let me know about the result.
Try the following things:
Delete deriveddata
Make sure you are not editing the ones in test folders.
Increase development ios version to 11.0

Build disappears after uploading to iTunesConnect

I am trying to upload build from Xamarin studio with application loader.
I have set all the Privacy usage description as i was missed to key before (Which were suggested by Apple)
and the keys are following with description :-
1) Location When In Use Usage Description :- Need to access Location for posting latitude longitude for event.
2) Privacy - Camera Usage Description :- This app needs access to the camera to take photos
3) Privacy - Photo Library Usage Description :- This app needs access to photos
4) Privacy - Contacts Usage Description :- For getting list of user contacts
5) Privacy - Calendar Usage Description :- use to set date of event
6) NSBluetoothPeripheralUsageDescription :- [App Name] would like to make data available to nearby bluetooth devices even when you're not using the app.
7)Privacy - Location Usage Description :- Need to access Location for posting latitude longitude for event
Build got validate and uploaded to iTunes successfully.
But for 15-20 minutes i can see only "Processing" in Activity tab in iTunes and when i reload page , its disappear.
My BitCode is Also Disable.
Please Select Requires Full Screen Before giving build. It Will solve your issue.
I solved this issue by just replacing NSBluetoothPeripheralUsageDescription to Privacy - Bluetooth Peripheral Usage Description and apple sent me mail for "The app's Info.plist must contain an NSBluetoothPeripheralUsageDescription key with a string value"

iOS 10 usage descriptions

iOS 10 requires you to have key in info.plist for each usage. When trying to submit app to iTunes I got an error.
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.
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.
NSCameraUsageDescription is from card.io, but what could the NSPhotoLibraryUsageDescription be from? Is there a way to know?
I'm using xamarin but I guess that doesn't make a difference.
EDIT: I know that you need to add key to info.plist, what I don't know is why do I need it because I'm not using photo library anywhere
You need NSPhotoLibraryUsageDescription if you're implementing a share sheet that includes the option to save an image (which goes to the "Camera Roll"). You may have implemented (or be using) a data source that can produce data in .JPG, .PNG, .TIF form. Prior to iOS 10 your user would have been asked for access to the Photo Library (or Camera Roll). Now, if they do so without your app providing a usage description (like "This app needs to be able to share an image in your Camera Roll."), your app crashes.
Open your app's plist file and add the key NSPhotoLibraryUsageDescription like so:
Make sure you include a description as to why the app needs the photo library.
Maybe it's used in some framework.

Resources