These are the steps mentioned in the package and I have followed everything:
Add the appropriate keys to your Info.plist,
If you are allowing user to select image/video from photos, add
NSPhotoLibraryUsageDescription.
If you are allowing user to capture image add NSCameraUsageDescription
key also.
If you are allowing user to capture video add NSCameraUsageDescription
add NSMicrophoneUsageDescription key also.
But it doesn't ask for gallery permissions and directly opens up the gallery on the iOS app. Will there be any problem with the app review because of this?
react-native : 0.63.3
react-native-image-picker: 4.8.4
I am creating a flutter app using webview_flutter plugin, everything is working fine. In the website, there is a form in which users can upload images(that asks to choose weather to use Camera or Album to choose image). When I tap on Camera the app crashes.
Are you using the latest version of webview_flutter? I did a flutter pub upgrade and added
<key>NSCameraUsageDescription</key>
<string>Add image to profile</string>
to ios/Runner/Info.plist.
Crashes happen because your app needs to request a permission from user to access camera or photos library (depending on what user picks). But in order to make such request you need to provide a message with description on why do you need this permission. Such description should be added into Info.plist file located in ios/Runner folder of the project.
For the case you described with picking image from camera or photos library you need to add the following 2 keys with descriptions:
<key>NSCameraUsageDescription</key>
<string>Your description on why app needs access to camera</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Your description on why app needs access to photos library</string>
Here is information about mentioned keys in the official docs:
https://developer.apple.com/documentation/bundleresources/information_property_list/nscamerausagedescription
https://developer.apple.com/documentation/bundleresources/information_property_list/nsphotolibraryusagedescription
One more case with webview when you would need to have NSPhotoLibraryUsageDescription or NSPhotoLibraryAddUsageDescription in project's Info.plist file is to avoid crashes when user tries to download image via Save to photos context menu item. Such context menu appears when user long presses on some image on a web page.
The difference between 2 keys above is in fact that NSPhotoLibraryAddUsageDescription allows your app to only write (download) images to photos library, not read them, so it is more preferable way if you only want to let image downloads.
Here is info about this key: https://developer.apple.com/documentation/bundleresources/information_property_list/nsphotolibraryaddusagedescription
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
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.
When trying to save an image to camera roll in iOS10 using
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil);
the app crashes without any information. Same exact method does not cause crash on iOS 9 devices
Add Below permission in Info.plist
<key>NSCameraUsageDescription</key>
<string>This app needs access to the camera to take photos.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This app needs access to photos.</string>
More info Click here
Edit you Info.plist
You need to add these line in the plist.
It will crash too if you're using camera. In case of this, I put the solutions here.
If you're using camera, you just need to add the first line.
If you're just using saving photo to local album, you only need to add the second line.
You can change the description to what you wanna claim. It shows in iOS Camera/Photo alertView to get user's permissoin.
This was kind of a sneaky update (I didn't hear about this at least), but for iOS10 there are new required Info.plist files for requiring access to assets such as Photos (which causes the crash in this case). Take a read here
http://useyourloaf.com/blog/privacy-settings-in-ios-10/
But for solving this specific problem, just this to your Info.plist source code:
<key>NSPhotoLibraryUsageDescription</key>
<string>Reason why you need the permissions here</string>