Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I request iOS storage permission in react native?

Tags:

react-native

I have found a package called react-native-permissions which gives most of the permissions in Android and iOS. Currently it is not supporting Storage permission in iOS. How can I request iOS storage permission in react native?

like image 217
Madhavan.V Avatar asked Oct 31 '18 11:10

Madhavan.V


People also ask

How do I get storage permissions in React Native?

So to ask permissions, React Native has a prebuilt feature in it which we can import and use it in our code. import { PermissionsAndroid } from 'react-native'; Before asking permissions to the user we have to declare that permissions in AndroidManifest. xml file.

How do I get storage permissions in iOS?

From the Settings app, tap Privacy to see all the permissions available on your phone. Tap on any entry to see the apps granted those permissions. Disable any unneeded permissions.

How do I give permission to the camera in React Native iOS?

In iOS, the user must explicitly grant permission for each app to access the camera and microphone. Before your app can use the capture system for the first time, the operating system shows an alert asking the user to grant your app access to the camera.


1 Answers

You need to add the following fields in your plist.

<key>NSPhotoLibraryAddUsageDescription</key>
<string>*your app name* would like to save photos from the app to your gallery</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>*your app name* would like to access your photo gallery for uploading images to the app</string>
like image 129
HungrySoul Avatar answered Sep 22 '22 16:09

HungrySoul