TCC __TCCAccessRequest_block_invoke - ios

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

Related

App is not asking for Photo Library usage permission

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

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

Application can't load photos from Photo Library on iOS simulator

I am facing problem in loading photos on simulator but it is working on devices. Even it is working on other mac. I have added the NSPhotoLibraryUsageDescription key into the plist file. But the permission message is not loading while I am going to access the photo library.
Instead I am getting the following scenario on simulator:
I have also checked the settings on simulator and my app is not showing on Photos privacy:
You need to add permission
Please read this link to load photos in iOS 10
https://iosdevcenters.blogspot.com/2016/09/infoplist-privacy-settings-in-ios-10.html
You need to give permission to your app to access photos. For this you need to do following steps:
Open settings in your simulator
Look for your App name and then tap on it.
Then turn on the switch to access photo's.

iOS 10: sharing image/save image started crashing

I have a code which shares a line of text and an image via UIActivityViewController. After I updated to iOS 10 it started crashing with the following log:
This app has crashed because it attempted 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.
I do not post the code since it seems to happen even in Apple's own example. I found a corresponding radar, but not StackOverflow topic.
Hope it will save someone's time. The fix is to add that line to your plist even though the app itself does not interact with the Photo Library. If anyone finds a better solution, it would be nice.
Please, note that it is different from a problem with UIImagePickerController - it is close to an opposite action.
Add NSPhotoLibraryUsageDescription to Info.plist :-( Don't leave it empty - it reuses Apple's default question, but it is fine only for development. Uploading such archive to App Store will trigger an error.

ios 7 background sync uploading pictures

I have studied the background syncing and multitasking capabilities of iOS 7. What cant figure out is the possibility to upload new photo's taken with the camera app.
The part to upload a file in the background isnt the hardest part, but what delegates do i have to use to detect wether a photo is taken and upload this particular latest photo?
Possible duplicate: iOS - Background uploading of photos
I think you can use Photos Framework to do it. There is a delegate method to callback if one photo is edited or added.
First Photos Framework only supports iOS8+;
#import Photos;
Implement PHPhotoLibraryChangeObserver protocol;
- (void)photoLibraryDidChange:(PHChange *)changeInstance {
if (![collectionChanges hasIncrementalChanges] || [collectionChanges hasMoves]) {} else {}
}
If I understand correctly, what you want to do just cannot be done on iOS (Apple security limitations).
If you want to upload a photo each time user takes a photo with Camera app (the OS built in Camera app), you would have to implement something such as folder scanning, to detect there is a new image in Photos folder. That would require access to complete file system, including files of all applications, which cannot be done due to Sandbox restriction.
In iOS, each application has it's own directory and you are allowed to write only to that directory. Access to files outside of it is always rejected (unless you are super user on a jailbroken phone).
Read more about iOS Sandbox:
https://developer.apple.com/library/ios/documentation/iphone/conceptual/iphoneosprogrammingguide/TheiOSEnvironment/TheiOSEnvironment.html
https://developer.apple.com/library/mac/documentation/security/conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html
What is Sandbox in ios , Can i Trans data between in one App to Another App in iPhone,if possible how
So what you can do on iOS, is to open a Camera picker view and allow the user to take a photo. After that you can easily access the photo and upload it to your server. Read more about it on the links below:
opening camera in iphone app programatically
https://developer.apple.com/library/ios/documentation/AudioVideo/Conceptual/CameraAndPhotoLib_TopicsForIOS/Articles/TakingPicturesAndMovies.html

Resources