ios access to album, ok in ipad, not ok in iphones - ios

Our app needs to access user's album.
NSPhotoLibraryUsageDescription is already set in Info.plist.
Works ok in ipad mini 1(ios 9.3.5), promote access to user's album and can access to user's album.
But not ok in iphones(iphone 6,ios 10), does not promote needs access to album and can not open user's album.
And there is no such setting as access to album in setting -> privacy.
Here is our info.plist:
edit:
It is a bug in our app.
Setting a wrong app route. ImagePicker library does not work correctly. Nothing to do with this plist. Has been fixed

It is a bug in our app.
Setting a wrong app root.
ImagePicker library does not work correctly.
Nothing to do with this plist. Has been fixed

Related

Camera and Photos permission - iOS [duplicate]

In my iOS app I am accessing the user's photo gallery. The first time the user does this, it asks them for permission. Some of my users have reported getting a crash this first time due to the permission request, but it works fine on subsequent tries.
To be able to test this on my own, I need to be able remove the permission from my iPad and have it prompt again. Is there a way to do this either through the iPad/iPhone itself or through code?
Run the Settings app. Go to General, then Reset. Tap on Reset Location & Privacy. This will reset all of your location and privacy settings, not just for your test app. But you are doing this on a development device so that should be OK. This works in the Simulator too.
In iOS 7+, you can go into Settings > Privacy > Photos and explicitly enable or disable access for individual apps.
This is much better than resetting your entire device privacy settings!
Another way is to temporary change Bundle Identifier (CFBundleIdentifier) in Info.plist.
System will treat such app as a new separate app and will display "would like to access your Photos" alert.
Don't forget to revert CFBundleIdentifier after you end testing.

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

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: can't get authorization to use images in MessagesExtensions app

I have been trying to access the PhotoLibrary in a Messages Extension app I am creating. I know that since iOS10, you need to include the NSPhotoLibraryUsageDescription in your info.plist, and I have done it. In fact, I created a test app that isn't a Messages Extension app, just a single view app, and it works fine: when the UIImagePickerController is called, the app asks for access to pictures, like it should. However, in my Messages Extension app, the code crashes before the app can ask for permission, even though the info.plist is exactly the same as for the test app.
Is there something specific about Messages Extension apps that could be the reason?
Thanks
This works fine in my Messages extension by just adding NSPhotoLibraryUsageDescription to the Info.plist file for the app itself--not the Info.plist for the extension.

Resources