Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add NSPhotoLibraryUsageDescription, NSCameraUsageDescription, and NSMicrophoneUsageDescription to info.plist for react-native-image-picker

Tags:

react-native

I'm new to xcode and react-native. I'm trying to use react-native-image-picker to add a user profile (uploaded to s3). react-native-image-picker's getting started assumes you have knowledge of info.plist. I'm not 100% sure how to proceed given:

For iOS 10+, Add the NSPhotoLibraryUsageDescription, NSCameraUsageDescription, and NSMicrophoneUsageDescription (if allowing video) keys to your Info.plist with strings describing why your app needs these permissions

I know the info.plists are found in the ios folder, but

  • which info.plist do these permissions need to get added to (there's multiple inside ios folder: build, RNapp, RNapp-tvOS, RNapp.xcodeproj, etc)?
  • how does the XML look?
  • Should this be happening in xcode instead of my text editor?

docs

like image 632
arcom Avatar asked Oct 15 '25 13:10

arcom


1 Answers

if you don't providing the privacy key in Info.plist, then your app is crash. You can see its log why crashed.

You will find these code below in the info.plist of your xcode , open in text editor. adding these will grant the permission for using camera, PhotoLibrary, Video

<key>NSCameraUsageDescription</key>
<string>${PRODUCT_NAME} Camera Usage</string>

<key>NSPhotoLibraryUsageDescription</key>
<string>${PRODUCT_NAME} PhotoLibrary Usage</string>

<key>NSVideoSubscriberAccountUsageDescription</key>
<string>${PRODUCT_NAME} Video Subscribe Usage</string>
like image 157
ashutosh pandey Avatar answered Oct 18 '25 08:10

ashutosh pandey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!